Divide Two Integers(https://leetcode.com/problems/divide-two-integers/)
Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.
Return the quotient after dividing dividend by divisor.
The integer division should truncate toward zero.
Example 1:
Input: dividend = 10, divisor = 3 Output: 3 Example 2:
Input: dividend = 7, divisor = -3 Output: -2 Note:
Both dividend and divisor will be 32-bit signed integers. The divisor will never be 0. Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the purpose of this problem, assume that your function returns 231 − 1 when the division result overflows.
Single number (https://leetcode.com/problems/single-number/)
Given a non-empty array of integers, every element appears twiceexcept for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
Example 1:
Input: [2,2,1]
Pair of Single numbers
An array of numbers is gven to you and there exists exactly two elements which appear once and other elements appear twice you need to give the two elements that appear only once. The order in which your result appears is not important and make sure that your algorithm runs in linear time complexity and constant space complexity.
Example:
Input: [1,2,1,3,3,4,4,8,2,5] Output: [8,5]
Output: 1
Example 2:
Input: [4,1,2,1,2]
Output: 4
Repeated DNA Sequences (https://leetcode.com/problems/repeated-dna-sequences/)
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
Write a function to find all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule.
Example:
Input: s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
Output: ["AAAAACCCCC", "CCCCCAAAAA"]