Tag: c++
Implement a data structure LastValueMap which has the following methods: void set(int key, int value) which associates key with value. void remove(int key) which removes key and its associated …
Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater …
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 …