Skip to content

arifulhb/coding-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Coding Problems! Solutions in PHP

By Ariful Haque

Lesson 01: Binary Gap

Find longest sequence of zeros in binary representation of an integer.

A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.

Lesson 02: Calculate Parking Fee

A parking garage charges a $2.00 minimum fee to park for up to three hours.

The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours.

Lesson 03: Find minimum cost of tickets

Find minimum cost of tickets required to buy for traveling on known days of the month (1...30).