Skip to content

Instantly share code, notes, and snippets.

@supritashankar
Last active August 29, 2015 14:21
Show Gist options
  • Save supritashankar/f9e5a28d399f812a63c2 to your computer and use it in GitHub Desktop.
Save supritashankar/f9e5a28d399f812a63c2 to your computer and use it in GitHub Desktop.
Buckets-robo
"""
Buckets Robo problem
Attempt #1
"""
begin = -1;
end = len(no_of_buckets);
loc = 0;
while (loc<end) {
switch (color) {
case Red:
begin++;
swap(buckets[loc], buckets[begin]);
loc++;
break;
case Blue:
end--;
swap(buckets[loc], buckets[end]);
break;
case Green:
loc++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment