Linked Questions

8
votes
20answers
849 views

String and ASCII [duplicate]

The Challenge Given a non-empty string containing only lowercase or uppercase letters and no spaces: Sum up the ASCII values for each character instance in the input string. The sum will be ...
505
votes
228answers
111k views

Showcase of Languages

Notes This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do ...
119
votes
95answers
21k views

ASCII's 95 Characters…95 Movie Quotes

Update: The winner has been decided, but the challenge is not over! Finally, nearly 3 months after the question first started, someone has remained the last answerer for more than a week! ...
33
votes
86answers
14k views

Is this number evil?

Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
35
votes
69answers
14k views

Sort numbers by binary 1's count

Goal Write a function or program sort an array of integers in descending order by the number of 1's present in their binary representation. No secondary sort condition is necessary. Example sorted ...
30
votes
69answers
8k views

Check whether an integer is a power of 2 without using +,- operations [closed]

Write a program that checks if the integer is a power of 2. Sample input: 8 Sample output: Yes Sample input: ...
14
votes
47answers
5k views

Print the amount of ones in a binary number without using bitwise operators

Description Given a number, print the amount of 1s it has in binary representation. Input A number >= 0 in base 10 that ...
18
votes
15answers
3k views

From 0 to 2^n - 1 in POPCORN order

... Ah sorry, no popcorn here, just POPCNT. Write the shortest program or function which takes in a number n and output all integers from 0 to 2n - 1, in ascending ...
11
votes
18answers
1k views

All Binary Combinations to Decimal

Disclaimer This question is not a duplicate of this question. I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal ...
2
votes
8answers
6k views

compute number of 1 bits in a binary representation of a number

The goal is to write a program that returns number of 1 bits in a given number. Examples 5 -> 2 1254 -> 6 56465 -> 8 Winner The winning ...
-4
votes
7answers
205 views

Determine length of bitstring

Optimize the following function for number of tokens: ...