Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

c++ bit array challenge

I'd like to know if anyone has solved this problem on this site.

https://www.hackerrank.com/challenges/bitset-1/problem

Even all the submitted answers cause compile error and it doesn't seem like anyone has ever gotten it write.
A few points on terms and operators..

Quote:S (modulo 2^31)


What is the ^ in this case? Is it raise to the power or is it XOR?
How are the parentheses significant?
What is the equivalent operation in C\C++ for modulo?

Just want to make sure the terms are understood before I look at this problem.
May you be given directions by software engineer document writers.
Just grabbed the first solution from the site, compiles fine on my system?
(Apr 7, 2020 02:22 AM)4Txe4y33C9zvNhMj Wrote:  Just grabbed the first solution from the site, compiles fine on my system?

For me when I try to compile it on the site it says the solution doesn't work.

(Apr 6, 2020 11:17 PM)saltycracker Wrote:  A few points on terms and operators..


What is the ^ in this case? Is it raise to the power or is it XOR?
How are the parentheses significant?
What is the equivalent operation in C\C++ for modulo?

Just want to make sure the terms are understood before I look at this problem.


I don't know how to interpret the problem, too advanced for me.
(Apr 6, 2020 11:17 PM)saltycracker Wrote:  A few points on terms and operators..


What is the ^ in this case? Is it raise to the power or is it XOR?
How are the parentheses significant?
What is the equivalent operation in C\C++ for modulo?

Just want to make sure the terms are understood before I look at this problem.

I believe, considering it is a constraint to the problem, it is not XOR but rather combinatorics towards the amnt of possible solutions.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersApr 14, 2024 12:50 PM 14 674 Apr 14, 2024 12:50 PM
Last Post: Hackers
[C#] by gigajewJul 18, 2021 11:17 AM 26 2,917 Jul 18, 2021 11:17 AM
Last Post: gigajew
[Python] by DocDec 9, 2020 12:23 PM 8 263 Dec 9, 2020 12:23 PM
Last Post: synchronizing