Category: c / c++
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, return whether there’s an integer whose frequency in the list is same as its value. Constraints n ≤ 100,000 where n is the …
Given a singly linked list node whose values are integers, determine whether the linked list forms a palindrome. A palindrome is defined as a sequence whose values are the …
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 …