Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums = nums and …
Write a SQL query to get the nth highest distinct salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 …
Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings …
Write an algorithm to determine if a number is “happy”. A happy number is a number defined by the following process: Starting with any positive integer, replace the number …
A Binary Search Tree (BST) is a binary tree that satisfies the following requirements: The value of a parent node is bigger than all values of its left sub …
A Singly Linked List is a one-direction List that uses a pointer to connect between Nodes. To reverse a linked list, you need to re-connect the directions, for example: …