Skip to content

Instantly share code, notes, and snippets.

@pixelcandy
Created February 12, 2020 15:27
Show Gist options
  • Save pixelcandy/4ec5aba946721f80f002c353378c6abf to your computer and use it in GitHub Desktop.
Save pixelcandy/4ec5aba946721f80f002c353378c6abf to your computer and use it in GitHub Desktop.
Brief Ruby Challenge

Instructions

  • Fork this gist.
  • Please complete the quick challenge below using Ruby, uploading additional files if necessary.
  • Reply back to the email you were sent with the link to your completed gist.

Abba Babba Binary Challenge

This challenge should take 10-15 minutes to complete.

Instructions:

Write a method that:

  • takes an integer as input
  • converts the number to binary
  • swaps any 1's for A's and swaps any 0's for B's and returns the output

Example: The binary representation of 12345 is 11000000111001 so your method should return AABBBBBBAAABBA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment