Find all combinations of IP address from a string of numbers

Q: Find all combinations of IP address from a string of numbers.

FYI,

IP Address

  1. We are looking at IPv4 which is 32 bit long, represented by 4 numbers ranging from - to 255 in 4 dots
  2. 0.0.0.0 (in number) === 00000000.00000000.00000000.00000000 (in bits) = 8bits.8bits.8bits.8bits = 1byte.1byte.1byte.1byte
  3. 8bit = 0 to 255 = 256 numbers in each part
  4. IP address ranges from 0.0.0.0 to 255.255.255.255
  5. 32 bits IP address means 256^4 = 4.3 billion IP addresses in the world. woah
  6. IPv6 has 128bits which means 340 trillion trillion trillion IP addresses. woah woah

Bit

  1. Bit = Binary Digit
  2. 1 bit = smallest unit of data in a computer
  3. 8 bits = 1 byte = 00000000 (in bits, 8 zeros, 2^8 numbers = 256, 0 - 255)
  4. n bits = 2^n ways the bits can be arranged = 0…n-1 (in binary) = 0 - 2^n -1 (in number)
  5. unsigned number means only positive integers; 0 - 2^n -1
  6. signed number means positive and negative integers; -2^n to 2^n - 1

Sample example,

Given a string: ‘1 2 3 4 5’,
Number of combinations:
1.2.3.4
1.2.3.45
1.2.3.5
1.2.34.5
1.2.4.5
1.23.4.5
1.3.4.5
12.3.4.5
2.3.4.5

Find pattern

Finding…

Solution

1
Solutioning...

NOTE: THIS IS AN ONGOING THINKING PROCESS. CHECK BACK LATER.

The End,

Day 8/100, dynamic programming has been fun. Time to enter the maze of graph.