This is another very important concept in computer science. Particularly because of how data is represented within machines.
Taking up bit arithmetic as a topic separately, let us initiate with understanding what those terms even mean.
In our customary base-ten system, we have digits for the numbers zero through nine. We do not have a single-digit numeral for “ten”. Yes, we write “10”, but its two digits; we have no single solitary digit that stands for “ten”.
There are 10 digits using which we represent all the numbers. Hence the base 10 system.
Similarily, binary number system or base 2 number system has only 2 digits 0, 1
. Hex number system or base 16
number system has 16 digits ( 0, 1, 2 .. 9, A, B, .. F
). In general a N base number system has N digits, 0, 1, ... N-1
( The digits usually after 9 are represented as A, B and so on ).
Base systems like binary and hexadecimal seem a bit strange at first. The key is understanding how different systems “tick over” like an odometer when they are full.
Base 10, our decimal system, “ticks over” when it gets 10 items, creating a new digit. We wait 60 seconds before “ticking over” to a new minute. Hexadecimal and binary are similar, but tick over every 16 and 2 items, respectively.
In computers, numbers are internally represented in binary number system.
We explore more in next slides.
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Total Moves For Bishop! | 75 |
|
31:10 | |
Distribute in Circle! | 100 |
|
22:06 | |
Prime Sum | 150 |
|
43:15 | |
Sum of pairwise Hamming Distance | 200 |
|
66:52 | |
FizzBuzz | 200 |
|
12:34 | |
Is Rectangle? | 200 |
|
11:31 | |
Step by Step | 200 |
|
52:49 | |
Power Of Two Integers | 250 |
|
39:36 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Excel Column Number | 175 |
|
23:19 | |
Excel Column Title | 175 |
|
41:11 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Palindrome Integer | 200 |
|
17:28 | |
Reverse integer | 200 |
|
28:36 | |
Next Smallest Palindrome! | 400 |
|
63:40 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Greatest Common Divisor | 200 |
|
10:57 | |
Find Nth Fibonacci | 200 |
|
54:44 | |
Divisible by 60 | 200 |
|
28:05 | |
Powerful Divisors | 200 |
|
44:10 | |
Trailing Zeros in Factorial | 250 |
|
18:58 | |
Sorted Permutation Rank | 250 |
|
78:34 | |
Largest Coprime Divisor | 250 |
|
49:35 | |
Sorted Permutation Rank with Repeats | 500 |
|
68:43 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
K-th Permutation | 200 |
|
51:38 | |
City Tour | 300 |
|
62:42 | |
Grid Unique Paths | 375 |
|
32:35 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Highest Score | 200 |
|
34:48 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Addition without Summation | 200 |
|
26:05 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Next Similar Number | 200 |
|
55:47 | |
Rearrange Array | 250 |
|
49:03 |
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Numbers of length N and value less than K | 200 |
|
90:00 |