An open API service indexing awesome lists of open source software.

Projects in Awesome Lists tagged with codewars-kata-solution

A curated list of projects in awesome lists tagged with codewars-kata-solution .

https://github.com/sammi-turner/ocaml-examples

This repo is designed to get you started with OCaml.

beginner-friendly codewars-kata-solution ocaml

Last synced: 05 Oct 2025

https://github.com/sammi-turner/assorted-golang

Example code, Codewars katas and a compiler for the Monkey programming language.

beginner-friendly codewars-kata-solution monkey-programming-language

Last synced: 16 Dec 2025

https://github.com/snykk/competitive-programming

my competitive programming journey https://www.codewars.com/users/snykk https://leetcode.com/snyk/

codeforces codewars codewars-kata-solution codewars-solutions competitive-programming cpp hackerrank leetcode leetcode-cpp leetcode-solutions problem solutions toki

Last synced: 16 Oct 2025

https://github.com/ngekoding/codewars

My solutions for codewars.com problems

codewars codewars-kata-solution codewars-solutions

Last synced: 18 Mar 2026

https://github.com/hungryvovka/codewars-python

My assignment solutions of Codewars tasks by using Python.

codewars codewars-kata-solution codewars-python codewars-solutions python

Last synced: 05 Apr 2025

https://github.com/hungryvovka/codewars-sql

My assignment solutions of Codewars tasks by using SQL.

codewars codewars-kata-solution codewars-solutions codewars-sql sql

Last synced: 19 Jan 2026

https://github.com/HaleyEllermann/CSharp_CodeWars

CodeWars C# Mini Kata Exercise problems and my solutions. All testable through Program.cs

codewars codewars-kata codewars-kata-solution codewars-solutions csharp csharp-code

Last synced: 14 May 2025

https://github.com/hungryvovka/codewars-javascript

My assignment solutions of Codewars tasks by using JavaScript (JS).

codewars codewars-javascript codewars-kata-solution codewars-solutions javascript

Last synced: 05 Apr 2025

https://github.com/haleyellermann/csharp_codewars

CodeWars C# Mini Kata Exercise problems and my solutions. All testable through Program.cs

codewars codewars-kata codewars-kata-solution codewars-solutions csharp csharp-code

Last synced: 06 Apr 2026

https://github.com/saadazghour/challenges-codewars

A repo of my completed CodeWars challenges & Algorithm challenges with Python.

algorithm-challenges challenges challenges-solved codewars-kata codewars-kata-solution python3 python3-tutorial

Last synced: 24 May 2026

https://github.com/bell-kevin/kebabize

Modify the kebabize function so that it converts a camel case string into a kebab case. kebabize('camelsHaveThreeHumps') // camels-have-three-humps kebabize('camelsHave3Humps') // camels-have-humps Notes: the returned string should only contain lowercase letters

codewars-kata-solution

Last synced: 15 Aug 2025

https://github.com/bell-kevin/jadensmith

Jaden Smith, the son of Will Smith, is the star of films such as The Karate Kid (2010) and After Earth (2013). Jaden is also known for some of his philosophy that he delivers via Twitter. When writing on Twitter, he is known for almost always capitalizing every word. For simplicity, you'll have to capitalize each word, check out how contractions are expected to be in the example below. Your task is to convert strings to how they would be written by Jaden Smith. The strings are actual quotes from Jaden Smith, but they are not capitalized in the same way he originally typed them. Example: Not Jaden-Cased: "How can mirrors be real if our eyes aren't real" Jaden-Cased: "How Can Mirrors Be Real If Our Eyes Aren't Real" Link to Jaden's former Twitter account @officialjaden via archive.org

code-wars-solution codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/findtheoddint

Given an array of integers, find the one that appears an odd number of times. There will always be only one integer that appears an odd number of times. Examples [7] should return 7, because it occurs 1 time (which is odd). [0] should return 0, because it occurs 1 time (which is odd). [1,1,2] should return 2, because it occurs 1 time (which is odd). [0,1,0,1,0] should return 0, because it occurs 3 times (which is odd). [1,2,2,3,3,3,4,3,3,3,2,2,1] should return 4, because it appears 1 time (which is odd).

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/findthecapitals

Find the capitals. Instructions Write a function that takes a single string (word) as argument. The function must return an ordered list containing the indexes of all capital letters in the string. Example Test.assertSimilar( capitals('CodEWaRs'), [0,3,4,6] );

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/equal-sides-of-an-array

Equal Sides Of An Array. 6 kyu

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/-training-js-12-loop-statement---for..in-and-for..of

Training JS #12: loop statement --for..in and for..of

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/omarsalem7/codewar-challenges

This repo for all challenges I solved in mob programming with my morning session team

codewars-kata-solution javascript problem-solving

Last synced: 17 Jun 2025

https://github.com/mattytomo365/codewars-solutions

A compilation of completed solutions for different Katas (tasks) on the Codewars platform. A means to maintain my proficiency in different languages.

codewars-kata-solution

Last synced: 15 May 2026

https://github.com/akshayone8/coding-challenges

JavaScript challenges, which include problems from LeetCode, CodeWars, and others.

codewars codewars-kata-solution freecodecamp freecodecamp-challenge javascript leetcode

Last synced: 27 Mar 2025

https://github.com/borisskert/typescript-katas

This repo contains my solutions for some TypeScript katas submitted in Codewars.

codewars codewars-kata codewars-kata-solution codewars-kata-solutions codewars-katas codewars-typescript typescript

Last synced: 17 Mar 2025

https://github.com/hungryvovka/codewars-c

My assignment solutions of Codewars tasks by using C.

c codewars codewars-c codewars-kata-solution codewars-solutions

Last synced: 05 Apr 2025

https://github.com/hungryvovka/codewars-f-sharp

My assignment solutions of Codewars tasks by using F#.

codewars codewars-f-sharp codewars-kata-solution codewars-solutions f-sharp

Last synced: 05 Apr 2025

https://github.com/hungryvovka/codewars-php

My assignment solutions of Codewars tasks by using PHP.

codewars codewars-kata-solution codewars-php codewars-solutions php

Last synced: 05 Apr 2025

https://github.com/bell-kevin/training-js-4-basic-data-types--array

In javascript, Array is one of basic data types. Define an empty array can use var arr=new Array() or var arr=[] Array has an attribute: length, if there is an array named arr, using arr.length to know how many elements are contained in the array. Each element in the array has an index, use arr[index] to get the value of element. index always start from 0, so the first element of array is arr[0], the last element of array is arr[arr.length-1]. If we want to add new elements to the array, you can use the array method: push(). It can add an element to the end of the array. Instead, if we want to remove the last element of the array, you can use the array method: pop(). for example: var arr=[1,2,3]; //define an array arr contains elements 1 2 3 arr.push(4); //add element 4 to arr console.log(arr) //[1,2,3,4] arr.pop(); //remove the last element from arr console.log(arr) //[1,2,3] Task I've written five function, each function receives a parameter: arr(an array), you should code something with arr. 1. getLength(arr) should return length of arr 2. getFirst(arr) should return the first element of arr 3. getLast(arr) should return the last element of arr 4. pushElement(arr) should push an element to arr, and then return arr 5. popElement(arr) should pop an element from arr, and then return arr When you have finished the work, click "Run Tests" to see if your code is working properly. In the end, click "Submit" to submit your code pass this kata.

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/codewars-style-ranking-system

Codewars style ranking system. 4 kyu. Write a class called User that is used to calculate the amount that a user will progress through a ranking system similar to the one Codewars uses. Business Rules: A user starts at rank -8 and can progress all the way to 8. There is no 0 (zero) rank. The next rank after -1 is 1. Users will complete activities. These activities also have ranks. Each time the user completes a ranked activity the users rank progress is updated based off of the activity's rank The progress earned from the completed activity is relative to what the user's current rank is compared to the rank of the activity A user's rank progress starts off at zero, each time the progress reaches 100 the user's rank is upgraded to the next level Any remaining progress earned while in the previous rank will be applied towards the next rank's progress (we don't throw any progress away). The exception is if there is no other rank left to progress towards (Once you reach rank 8 there is no more progression). A user cannot progress beyond rank 8. The only acceptable range of rank values is -8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8. Any other value should raise an error. The progress is scored like so: Completing an activity that is ranked the same as that of the user's will be worth 3 points Completing an activity that is ranked one ranking lower than the user's will be worth 1 point Any activities completed that are ranking 2 levels or more lower than the user's ranking will be ignored Completing an activity ranked higher than the current user's rank will accelerate the rank progression. The greater the difference between rankings the more the progression will be increased. The formula is 10 * d * d where d equals the difference in ranking between the activity and the user. Logic Examples: If a user ranked -8 completes an activity ranked -7 they will receive 10 progress If a user ranked -8 completes an activity ranked -6 they will receive 40 progress If a user ranked -8 completes an activity ranked -5 they will receive 90 progress If a user ranked -8 completes an activity ranked -4 they will receive 160 progress, resulting in the user being upgraded to rank -7 and having earned 60 progress towards their next rank If a user ranked -1 completes an activity ranked 1 they will receive 10 progress (remember, zero rank is ignored)

codewars-kata-solution

Last synced: 27 Oct 2025

https://github.com/bell-kevin/delete-occurrences-of-an-element-if-it-occurs-more-than-n-times

Enough is enough! Alice and Bob were on a holiday. Both of them took many pictures of the places they've been, and now they want to show Charlie their entire collection. However, Charlie doesn't like these sessions, since the motif usually repeats. He isn't fond of seeing the Eiffel tower 40 times. He tells them that he will only sit for the session if they show the same motif at most N times. Luckily, Alice and Bob are able to encode the motif as a number. Can you help them to remove numbers such that their list contains each number only up to N times, without changing the order? Task Given a list and a number, create a new list that contains each number of list at most N times, without reordering. For example if the input number is 2, and the input list is [1,2,3,1,2,1,2,3], you take [1,2,3,1,2], drop the next [1,2] since this would lead to 1 and 2 being in the result 3 times, and then take 3, which leads to [1,2,3,1,2,3]. With list [20,37,20,21] and number 1, the result would be [20,37,21].

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-22-unlock-new-skills--arrow-function-spread-operator-and-deconstruction

Training JS #22: Unlock new skills--Arrow function,spread operator and deconstruction

codewars-kata-solution

Last synced: 31 Jul 2025

https://github.com/bell-kevin/replace-with-alphabet-position

Welcome. In this kata you are required to, given a string, replace every letter with its position in the alphabet. If anything in the text isn't a letter, ignore it and don't return it. "a" = 1, "b" = 2, etc. Example alphabetPosition("The sunset sets at twelve o' clock.") Should return "20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11" ( as a string )

codewars-kata-solution

Last synced: 02 Aug 2025

https://github.com/bell-kevin/stringincrementer

Your job is to write a function which increments a string, to create a new string. If the string already ends with a number, the number should be incremented by 1. If the string does not end with a number. the number 1 should be appended to the new string. Examples: foo -> foo1 foobar23 -> foobar24 foo0042 -> foo0043 foo9 -> foo10 foo099 -> foo100 Attention: If the number has leading zeros the amount of digits should be considered.

codewars-kata-solution

Last synced: 11 Aug 2025

https://github.com/hungryvovka/codewars-elixir

My assignment solutions of Codewars tasks by using Elixir.

codewars codewars-elixir codewars-kata-solution codewars-solutions elixir

Last synced: 25 Aug 2025

https://github.com/zayniddindev/codewars

Codewars Problems' Solutions

codewars-kata-solution

Last synced: 20 Jun 2026

https://github.com/juanma-gutierrez/ejercicios-codewars-java

Repositorio con soluciones a los ejercicios de la web Codewars realizados en Java

codewars codewars-kata codewars-kata-solution codewars-solutions ejercicios exercises gamification java

Last synced: 11 Jun 2026

https://github.com/indra87g/codewars

collection of Codewars challenges I have successfully completed

codehub codewars codewars-kata-solution

Last synced: 15 May 2025

https://github.com/hungryvovka/codewars-coffeescript

My assignment solutions of Codewars tasks by using CoffeeScript.

codewars codewars-coffeescript codewars-kata-solution codewars-solutions coffeescript

Last synced: 27 Mar 2025

https://github.com/bell-kevin/training-js-9-loop-statement---while-and-do..while

If you want your code to do a lot of similar work, a loop statement is a good choice. For example, if we need to calculate the cumulative value from 1 to 10, we can write code like this:

codewars-kata-solution

Last synced: 10 Jun 2025

https://github.com/programmergnome/basics-of-interesting-programming-languages

Mini task for learning interesting programming languages.

codewars-kata-solution programming-languages

Last synced: 02 Jul 2025

https://github.com/vanesa-r/javascript

Aprendiendo JavaScript desde 0. Teoría y ejercicios prácticos para aprender a programar (y pensar) practicando.

codewars-kata-solution dom es6 exercises-code-javascript javascript

Last synced: 16 Mar 2025

https://github.com/bell-kevin/persistentbugger

Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you must multiply the digits in num until you reach a single digit. For example (Input --> Output): 39 --> 3 (because 3*9 = 27, 2*7 = 14, 1*4 = 4 and 4 has only one digit) 999 --> 4 (because 9*9*9 = 729, 7*2*9 = 126, 1*2*6 = 12, and finally 1*2 = 2) 4 --> 0 (because 4 is already a one-digit number)

code-wars-solution codewars-kata-solution

Last synced: 12 Jun 2025

https://github.com/bell-kevin/where-is-my-parent-cry-

Mothers arranged a dance party for the children in school. At that party, there are only mothers and their children. All are having great fun on the dance floor when suddenly all the lights went out. It's a dark night and no one can see each other. But you were flying nearby and you can see in the dark and have ability to teleport people anywhere you want. Legend: -Uppercase letters stands for mothers, lowercase stand for their children, i.e. "A" mother's children are "aaaa". -Function input: String contains only letters, uppercase letters are unique. Task: Place all people in alphabetical order where Mothers are followed by their children, i.e. "aAbaBb" => "AaaBbb".

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-5-basic-data-types--object

In javascript, Object is one of basic data types. Define an Object can use var obj=new Object() or var obj={} You can define the object attributes during initialization, like this: var animal={name:"dog"} you can also set/get some properties after the object definition, like this: var animal={} animal.name="dog" (or animal["name"]="dog") Task Give you a function animal, accept 1 parameter:obj like this: {name:"dog",legs:4,color:"white"} and return a string like this: "This white dog has 4 legs." When you have finished the work, click "Run Tests" to see if your code is working properly. In the end, click "Submit" to submit your code pass this kata.

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-21-methods-of-string-object--trim-and-the-string-template

Training JS #21: Methods of String object--trim() and the string template

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/thecouponcode

Story Your online store likes to give out coupons for special occasions. Some customers try to cheat the system by entering invalid codes or using expired coupons. Task Your mission: Write a function called checkCoupon which verifies that a coupon code is valid and not expired. A coupon is no more valid on the day AFTER the expiration date. All dates will be passed as strings in this format: "MONTH DATE, YEAR". Examples: checkCoupon("123", "123", "July 9, 2015", "July 9, 2015") === true checkCoupon("123", "123", "July 9, 2015", "July 2, 2015") === false

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-1-create-your-first-js-function-and-print-hello-world-

In JavaScript, your code is running in a function, let us step by step complete your first JS function. Look at this example: --------keyword "function" | ----your function name | | ---if needed, some arguments will appear in brackets | | | function myfunc(){ ---------your function code will starting with "{" //you should type your code here }----------------------------ending with "}" If we want to print some to the screen, maybe we can use Document.write() in the web, or use alert() pop your message, but Codewars did not support these methods, we should use console.log() in your function. see this example: function printWordToScreen(){ var somewords="This is an example." console.log(somewords) } If we run this function, This is an example. will be seen on the screen. As you see, console.log() is an useful method help your work, you will become more and more like it. Task Please refer to two example above and write your first JS function. mission 1: use keyword function to define your function, function name should be helloWorld(don't forget the () and {}) mission 2: use keyword var (or let or const) to define a variable str, value of str should be a string: "Hello World!"(don't forget the =). mission 3: type the console.log() in the next line(don't forget to put the str in the brackets). When you have finished the work, click "Run Tests" to see if your code is working properly. In the end, click "Submit" to submit your code pass this kata.

codewars-kata-solution

Last synced: 05 Oct 2025

https://github.com/sameem420/codewars_codekatarust

Solution of KATA or CHALLENGES of RUST programming language from CodeWars.

codewars codewars-kata-solution codewars-rust rust rust-lang rustcodewars

Last synced: 16 Oct 2025

https://github.com/hungryvovka/codewars-c-sharp

My assignment solutions of Codewars tasks by using C#.

c-sharp codewars codewars-csharp codewars-kata-solution codewars-solutions

Last synced: 19 Oct 2025

https://github.com/bell-kevin/growth-of-a-population

Growth of a Population. 7 kyu

codewars-kata-solution

Last synced: 25 Oct 2025

https://github.com/hungryvovka/codewars-visualbasic

My assignment solutions of Codewars tasks by using Visual Basic (VB).

codewars codewars-kata-solution codewars-solutions codewars-visualbasic visual-basic

Last synced: 14 Feb 2026

https://github.com/bell-kevin/word-a10n-abbreviation

The word i18n is a common abbreviation of internationalization in the developer community, used instead of typing the whole word and trying to spell it correctly. Similarly, a11y is an abbreviation of accessibility. Write a function that takes a string and turns any and all "words" (see below) within that string of length 4 or greater into an abbreviation, following these rules: A "word" is a sequence of alphabetical characters. By this definition, any other character like a space or hyphen (eg. "elephant-ride") will split up a series of letters into two words (eg. "elephant" and "ride"). The abbreviated version of the word should have the first letter, then the number of removed characters, then the last letter (eg. "elephant ride" => "e6t r2e"). Example abbreviate("elephant-rides are really fun!") // ^^^^^^^^*^^^^^*^^^*^^^^^^*^^^* // words (^): "elephant" "rides" "are" "really" "fun" // 123456 123 1 1234 1 // ignore short words: X X // abbreviate: "e6t" "r3s" "are" "r4y" "fun" // all non-word characters (*) remain in place // "-" " " " " " " "!" === "e6t-r3s are r4y fun!"

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-8-conditional-statement--switch

Training JS #8: Conditional statement--switch. function howManydays(month){ var days; switch (month){ case 2: days = 28; break; case 4: case 6: case 9: case 11: days= 30; break; default: days= 31; } return days; }

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-3-basic-data-types--string

In javascript, String is one of basic data types. Use "" or '' to declare a string variable. It can be letters:a,b,c,A,B,C, numbers: 123..., Various symbol:@#$%^&* , Control symbol:\n,\t etc.. String can use operators +, Connect two or more strings together. Task misson 1: I've create three function, and defined some global variables, please select some variables that can make up the name of the function, and return them(Please note the uppercase and lowercase letters are different). When you have finished the work, click "Run Tests" to see if your code is working properly. misson 2: After misson 1 finished. you should click "Attempt" to see my three questions, and write the answer in function answer1, answer2,answer3

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-18-methods-of-string-object--concat-split-and-its-good-friend-join-

Training JS #18: Methods of String object--concat() split() and its good friend join()

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-7-if..else-and-ternary-operato.

Training-JS-7-if..else-and-ternary-operato.

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/twosum

Write a function that takes an array of numbers (integers for the tests) and a target number. It should find two different items in the array that, when added together, give the target value. The indices of these items should then be returned in a tuple / list (depending on your language) like so: (index1, index2). For the purposes of this kata, some tests may have multiple answers; any valid solutions will be accepted. The input will always be valid (numbers will be an array of length 2 or greater, and all of the items will be numbers; target will always be the sum of two different items from that array). Based on: http://oj.leetcode.com/problems/two-sum/

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-2-basic-data-types--number

In javascript, Number is one of basic data types. It can be positive: 1,2,3, negative:-1,-100 , integer:123,456, decimal:3.1415926,-8.88 etc.. Numbers can use operators such as + - * / % Task I've written five function equal1,equal2,equal3,equal4,equal5, defines six global variables v1 v2 v3 v4 v5 v6, every function has two local variables a,b, please set the appropriate value for the two variables(select from v1--v6), making these function return value equal to 100. the function equal1 is completed, please refer to this example to complete the following functions.

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-11-loop-statement---break-continue

Training JS #11: loop statement --break,continue

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-23-methods-of-arrayobject---push-pop-shift-and-unshift-

Training JS #23: methods of arrayObject---push(), pop(), shift() and unshift(). From this Kata, I will do some changes: to reduce the description of the text (to provide a reference link). Because I am not good at writing these words of description. Examples and essential points will be retained. At this lesson, we will learn some methods about add/remove array elements.

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/to-square-root-or-not-to-square-root-

To square(root) or not to square(root). java. kata. code wars. solution. 8 kyu. Write a method, that will get an integer array as parameter and will process every number from this array. Return a new array with processing every number of the input-array like this: If the number has an integer square root, take this, otherwise square the number. example [4,3,9,7,2,1] becomes [2,9,3,49,4,1] The input array will always contain only positive numbers, and will never be empty or null.

codewars-kata-solution

Last synced: 16 Jul 2025

https://github.com/bell-kevin/training-js-20-methods-of-string-object--charat-charcodeat-and-fromcharcode-

Training JS #20: Methods of String object--charAt() charCodeAt() and fromCharCode()

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-24-methods-of-arrayobject---splice-and-slice-

Training JS #24: methods of arrayObject---splice() and slice().

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-19-methods-of-string-object--touppercase-tolowercase-and-replace-

Training JS #19: Methods of String object--toUpperCase() toLowerCase() and replace()

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-10-loop-statement---for

Training JS #10: loop statement --for. function pickIt(arr){ var odd=[], even=[]; for (let i = 0; i < arr.length; i++) { if (arr[i] % 2 === 0) { even.push(arr[i]) } else { odd.push(arr[i]) } } return [odd,even]; }

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-17-methods-of-string-object--indexof-lastindexof-and-search-

Training JS #17: Methods of String object--indexOf(), lastIndexOf() and search()

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/training-js-15-methods-of-number-object--tofixed-toexponential-and-toprecision-

Training JS #15: Methods of Number object--toFixed(), toExponential() and toPrecision()

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/rockpaperscissors

Rock Paper Scissors. kata solution. code wars. Let's play! You have to return which player won! In case of a draw return draw

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/salesmanstravel

A traveling salesman has to visit clients. He got each client's address e.g. "432 Main Long Road St. Louisville OH 43071" as a list. The basic zipcode format usually consists of two capital letters followed by a white space and five digits. The list of clients to visit was given as a string of all addresses, each separated from the others by a comma, e.g. : "123 Main Street St. Louisville OH 43071,432 Main Long Road St. Louisville OH 43071,786 High Street Pollocksville NY 56432". To ease his travel he wants to group the list by zipcode. Task The function travel will take two parameters r (addresses' list of all clients' as a string) and zipcode and returns a string in the following format: zipcode:street and town,street and town,.../house number,house number,... The street numbers must be in the same order as the streets where they belong. If a given zipcode doesn't exist in the list of clients' addresses return "zipcode:/" Examples r = "123 Main Street St. Louisville OH 43071,432 Main Long Road St. Louisville OH 43071,786 High Street Pollocksville NY 56432" travel(r, "OH 43071") --> "OH 43071:Main Street St. Louisville,Main Long Road St. Louisville/123,432" travel(r, "NY 56432") --> "NY 56432:High Street Pollocksville/786" travel(r, "NY 5643") --> "NY 5643:/" Note for Elixir: In Elixir the empty addresses' input is an empty list, not an empty string. Note: You can see a few addresses and zipcodes in the test cases.

codewars-kata-solution

Last synced: 17 Mar 2025

https://github.com/bell-kevin/reverseorrotate

The input is a string str of digits. Cut the string into chunks (a chunk here is a substring of the initial string) of size sz (ignore the last chunk if its size is less than sz). If a chunk represents an integer such as the sum of the cubes of its digits is divisible by 2, reverse that chunk; otherwise rotate it to the left by one position. Put together these modified chunks and return the result as a string. If sz is <= 0 or if str is empty return "" sz is greater (>) than the length of str it is impossible to take a chunk of size sz hence return "". Examples: revrot("123456987654", 6) --> "234561876549" revrot("123456987653", 6) --> "234561356789" revrot("66443875", 4) --> "44668753" revrot("66443875", 8) --> "64438756" revrot("664438769", 8) --> "67834466" revrot("123456779", 8) --> "23456771" revrot("", 8) --> "" revrot("123456779", 0) --> "" revrot("563000655734469485", 4) --> "0365065073456944" Example of a string rotated to the left by one position: s = "123456" gives "234561".

codewars-kata-solution

Last synced: 30 Oct 2025