Tag: c++
You’ve devised a simple encryption method for alphabetic strings that shuffles the characters in such a way that the resulting string is hard to quickly read, but is easy …
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value …
Given the root of a binary tree and a node u in the tree, return the nearest node on the same level that is to the right of u, …
Given an array of positive integers arr, calculate the sum of all possible odd-length subarrays. A subarray is a contiguous subsequence of the array. Return the sum of all …
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. Example: MovingAverage m = new MovingAverage(3); m.next(1) = 1 …