# Leetcode :1 Two Sum

Problem Statement :

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 exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

# Approach :

The brute force way :

Pick an element and then loop over the entire list to find if target minus element exists. This will be O(N²) time and we can do better.

Single Pass :

We can combined looking for the pair of indices into a…

# Question:

Convert a non-negative integer `num` to its English words representation.

Example 1:

`Input: num = 123Output: "One Hundred Twenty Three"`

Example 2:

`Input: num = 12345Output: "Twelve Thousand Three Hundred Forty Five"`

Example 3:

`Input: num = 1234567Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"`

Example 4:

`Input: num = 1234567891Output: "One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety One"`

You may have noticed I have highlighted a few keywords in the examples. Try to look for some sort of pattern before you proceed.

# Intuition

I…

## Saurav Anchlia

I am a software developer working at Oracle.

Get the Medium app