Given an integer array nums and an integer k, return the kth largest element in the array.
Posts for: #Algorithm
Leetcode - Rotate Array
Given an array, rotate the array to the right by k
steps, where k
is non-negative.
Leetcode - Merge Intervals
Given an array of intervals
where intervals[i] = [starti, endi]
, merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.
Leetcode - Maximum Length of a Concatenated String with Unique Characters
You are given an array of strings arr
. A string s
is formed by the concatenation of a subsequence of arr
that has unique characters.
Leetcode - Average Salary Excluding the Minimum and Maximum Salary
You are given an array of unique integers salary
where salary[i]
is the salary of the ith
employee.
Leetcode - Count Odd Numbers in an Interval Range
Given two non-negative integers low
and high
. Return the count of odd numbers between low
and high
(inclusive).
Leetcode - Add Two Numbers
ou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
Leetcode - Swap Nodes In Pairs
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list’s nodes (i.e., only nodes themselves may be changed.)
Leetcode - Add Strings
Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string.
Leetcode - Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactlyvone solution, and you may not use the same element twice.