{"id":27083768,"url":"https://github.com/geektimus/java-challenges","last_synced_at":"2025-08-03T21:41:41.165Z","repository":{"id":82696791,"uuid":"122677126","full_name":"geektimus/java-challenges","owner":"geektimus","description":"This repo will contain the solutions using Java 8 for some coding challenges","archived":false,"fork":false,"pushed_at":"2025-01-02T05:37:02.000Z","size":103,"stargazers_count":12,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T03:19:05.608Z","etag":null,"topics":["challenge","coding-challenges","java-8"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geektimus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-23T21:59:43.000Z","updated_at":"2025-01-14T22:14:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"32e74e4a-4a44-44f0-8a67-dcf0c792379d","html_url":"https://github.com/geektimus/java-challenges","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geektimus/java-challenges","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-challenges","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-challenges/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-challenges/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-challenges/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geektimus","download_url":"https://codeload.github.com/geektimus/java-challenges/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geektimus%2Fjava-challenges/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268618267,"owners_count":24279243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["challenge","coding-challenges","java-8"],"created_at":"2025-04-06T03:19:09.362Z","updated_at":"2025-08-03T21:41:41.110Z","avatar_url":"https://github.com/geektimus.png","language":"Java","readme":"# Java Coding Challenges\n\n[![Build Status](https://travis-ci.org/geektimus/java-challenges.svg?branch=master)](https://travis-ci.org/geektimus/java-challenges)\n\nThis repo will contain the solutions using Java 8 for challenges found on:\n\n* Books\n* Hacker Rank\n* Codility\n* CodeFights\n\n## Challenges\n\n### Codility\n\n#### Can we sort an array with a simple swap?\n\nWe need to write a function that will return true if we can sort an array swapping only two elements.\n\n#### Mystery number\n\nWe need to write a function to shuffle the digits on a number on a particular way. The first char with the last char,\nthe second char with the second to last char until we use all the digits.\n\n#### Find the longest sentence.\n\nWe have phrases composed by sentences and each of this sentences contain words. We need to write a function that will\ngive us the number of words on the longest sentence. The sentences are separated by \"?\", \"!\", \".\" and the words simply\nby spaces (\" \").\n\n#### Binary Gap\n\nA 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.\n\n#### CyclicRotation\n\nWe need to perform an array shift to the right a given number of times.\n\n#### Frog Jumps\n\nA little frog wants to cross to the other side of the river, but it can only jump to the leaves that fall on the water\nand only then the complete path from 0 to target has all required leaves.\nGiven the starting position 0, and a non empty array indexed by each second and the position of the leaf. Find the earliest\ntime when the frog can jump all the way from 0 to the target position.\n\n#### Permutation Check\n\nWe need to perform a check on an array to see if it's a permutation of N elements where N original size of the array.\n\n**Note:** A permutation is a sequence containing each element from 1 to N once, and only once.\n\n#### Max Counter (Counter Operations)\n\nWe need to calculate the values of counters after applying all alternating operations: increase counter by 1; set\nvalue of all counters to current maximum.\n\n#### Minimum Number of Plays on a Casino (\\*)\n\nA guy walks out of a Casino with N chips. We know that he played W times an all in.\nWe need to find the minimum number of plays he could play on the casino to earn those N chips.\n\n#### Factory of Shoes (\\*)\n\nWe have a line of shoes composed of Left (L) and Right (R) shoes. We want to assign a group of workers to work on the\nshoes, but we need to guarantee that we assign each worker a group of shoes that contains the same number of L and R shoes.\n\n### Hacker Rank\n\n#### Odd number generator\n\nWe need to write a function that return all the odd numbers on a range given the start and the end of the range as\nintegers. This collection will include the start and end integers if they are odd numbers too\n\n### Books\n\n#### Unique characters\n\nWe need to write a function that will tell us if all the characters on a given string are unique.\n\n#### Check permutation\n\nWe need to write a function that given two strings let us find if one is a permutation of the other.\n\n#### URL Friendly String\n\nGiven a String and its true length, transform the string to a URL friendly string by replacing the spaces by %20\n\n**Note:** We can assume that the string contains a length that allow us to store the additional chars\nwithout having to allocate a new string.\n\n### Others (Challenges proposed by Friends or Solved on hackatons)\n\n#### Recursively reverse a string\n\nGiven a string, reverse the characters and return\n\n#### Find the first char that repeats itself on a given string\n\nGiven a string, find the first chat that repeats itself.\n\n#### Sort server logs by two fields\n\nWe had to sort a list of logs given the log level, or the event timestamp.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektimus%2Fjava-challenges","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeektimus%2Fjava-challenges","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektimus%2Fjava-challenges/lists"}