Skip to content

Implementations of various coding challenges written in Java

Notifications You must be signed in to change notification settings

Kaliszando/coding-challenges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Challenges

Build Status

In this repository I collect all the algorithmic tasks I have solved. Each assignment has been solved by me, but not all solutions are mine.

Table of contents

Particulars of the challenges

FizzBuzz


Write a program that prints the numbers from 1 to 100 and for multiples of '3' print "Fizz" instead of the number and for the multiples of '5' print "Buzz".

My solution returns String values instead of printing to console.

source, solution

Two smallest numbers


Write a function that takes array of integer numbers and returns two elements, the sum of which is smallest in a whole array

Instead of sorting the array, you can traverse the array only once, which gives O(n) complexity.

source, solution

Two sum


Given an array of integers 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. Array of integers is not sorted.

source, solution

Reverse integer


Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned).

source, solution

Palindrome


Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.

source, solution

Roman to Integer


Given a roman numeral, convert it to an integer. Constraints:

  • String roman contains only the characters ('I', 'V', 'X', 'L', 'C', 'D', 'M')
  • It is guaranteed that roman is a valid roman numeral in the range [1, 3999]

source, solution

About

Implementations of various coding challenges written in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages