Tag: c++
Given an array nums. We define a running sum of an array as runningSum = sum(nums…nums). Return the running sum of nums. Example 1: Input: nums = Output: Explanation: …
Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals pre and post are distinct positive integers. Example 1: Input: pre = , …
Given an array of integers nums and an integer k. A subarray is called nice if there are k odd numbers on it. Return the number of nice sub-arrays. …
Given the root of a binary tree, each node has a value from 0 to 25 representing the letters ‘a’ to ‘z’: a value of 0 represents ‘a’, a …
You are given an array coordinates, coordinates = , where represents the coordinate of a point. Check if these points make a straight line in the XY plane. Input: …