Category: c / c++
You are given a list of integers nums which contains at least one 1. Return whether all the 1s appear consecutively. Constraints 1 ≤ n ≤ 100,000 where n …
Given an integer list nums where each number represents the maximum number of hops you can make, return the minimum number of hops it would take to reach the …
Given a 2-d array matrix, return elements in spiral order starting from matrix. Constraints n, m ≤ 250 where n and m are the number of rows and columns …
Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000. Example 1: Input: “bbbab” Output: 4 …
The cout is a very easy but powerful techique to debug (for example, submiting code to Online Judge). However, by default, the C++ cout does not accept the vector …