Tag: c++
Given a binary tree root, return the leftmost node’s value on each level of the tree. Constraints n ≤ 100,000 where n is the number of nodes in root …
Given an N by N matrix of letters matrix, return whether there are exactly N different letters that appear in the matrix and each letter appears exactly once in …
Given a list of integers nums, sort the array such that: All even numbers are sorted in increasing order All odd numbers are sorted in decreasing order The relative …
Given a list of integers nums, swap each consecutive even indexes with each other, and swap each consecutive odd indexes with each other. Example 1 Input nums = Output …
Given a two-dimensional integer matrix, sort each of the diagonals descending from left to right in ascending order. Constraints n, m ≤ 25 where n and m are the …