Sign up
Log in
Home
Language tracks
Nim track
Exercises
Exercises on the Nim track
Join the Nim Track
34 exercises to help you master Nim
easy
Hello World
The classical introductory exercise. Just say "Hello, World!"
conditionals
optional values
text formatting
easy
Two Fer
Create a sentence of the form "One for X, one for me."
conditionals
optional values
text formatting
easy
Leap
Given a year, report if it is a leap year.
booleans
conditionals
logic
easy
Reverse String
Reverse a string
strings
easy
Isogram
Determine if a word or phrase is an isogram.
algorithms
conditionals
loops
maps
strings
easy
Pangram
Determine if a sentence is a pangram.
algorithms
conditionals
filtering
logic
loops
strings
easy
RNA Transcription
Given a DNA strand, return its RNA Complement Transcription.
conditionals
logic
loops
maps
strings
transforming
easy
Hamming
Calculate the Hamming difference between two DNA strands.
algorithms
conditionals
filtering
logic
loops
sequences
sets
strings
easy
Word Count
Given a phrase, count the occurrences of each word in that phrase.
algorithms
logic
pattern recognition
strings
text formatting
easy
Gigasecond
Given a moment, determine the moment that would be after a gigasecond has passed.
dates
time
easy
Bob
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
conditionals
equality
strings
easy
Run Length Encoding
Implement run-length encoding and decoding.
algorithms
strings
text formatting
easy
Armstrong Numbers
Determine if a number is an Armstrong number
algorithms
loops
math
easy
Grains
Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.
integers
type conversion
easy
Difference Of Squares
Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.
math
easy
Anagram
Given a word and a list of possible anagrams, select the correct sublist.
algorithms
logic
parsing
strings
easy
Allergies
Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
bitwise operations
classes
enumerations
easy
Atbash Cipher
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
algorithms
conditionals
loops
strings
easy
Sum Of Multiples
Given a number, find the sum of all the multiples of particular numbers up to but not including that number.
integers
math
easy
Collatz Conjecture
Calculate the number of steps to reach 1 using the Collatz conjecture
loops
math
easy
Acronym
Convert a long phrase to its acronym
regular expressions
strings
easy
Grade School
Given students' names along with the grade that they are in, create a roster for the school
conditionals
filtering
integers
lists
sorting
strings
classes
easy
Roman Numerals
Write a function to convert from normal numbers to Roman Numerals.
conditionals
integers
logic
loops
strings
easy
Space Age
Given an age in seconds, calculate how old someone is in terms of a given planet's solar years.
conditionals
floating point numbers
integers
easy
Scrabble Score
Given a word, compute the scrabble score for that word.
games
loops
maps
strings
easy
Nth Prime
Given a number n, determine what the nth prime is.
algorithms
lists
loops
math
easy
Bracket Push
Make sure the brackets and braces all match.
parsing
recursion
stacks
strings
easy
Queen Attack
Given the position of two queens on a chess board, indicate whether or not they are positioned so that they can attack each other.
arrays
exception handling
games
logic
matrices
easy
Triangle
Determine if a triangle is equilateral, isosceles, or scalene.
classes
conditionals
easy
All Your Base
Convert a number, represented as a sequence of digits in one base, to any other base.
math
easy
Nucleotide Count
Given a DNA string, compute how many times each nucleotide occurs in the string.
misc
easy
Raindrops
Convert a number to a string, the contents of which depend on the number's factors.
misc
hard
React
Implement a basic reactive system.
callbacks
events
reactive programming