6 kyu

Playing with digits

3,724 of 143,429g964
Description
Loading description...
Fundamentals
Mathematics
  • Please sign in or sign up to leave a comment.
  • SwapnilMah Avatar

    how to know which input they used in test 10 or any failed test?

  • zajkusik Avatar

    This comment has been hidden.

  • trashy_incel Avatar

    the random tests always expect -1 in JS and OCaml, possibly other languages

  • Wei-Ting Yang Avatar

    In C, there's an annoying warning:

    fixture.c:38:13: warning: passing 'const int [31][3]' to parameter of type 'int (*)[3]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        shuffle(data, 31);
                ^~~~
    fixture.c:16:25: note: passing argument to parameter 'a' here
    static void shuffle(int a[][3], int n) {
                            ^
    1 warning generated.
    

    I think the const should be removed.

  • mitleonid Avatar

    This comment has been hidden.

  • PetitLu117 Avatar

    js fork 🤖🤖🤖

    • added random tests
    • used mocha/chai assertions
    • used lodash for randomness
    • provided inputs on failure
  • OviMG Avatar

    I don't think of how much k can be, bc idk the max values for n or p, so the code freezes on codewars for veeery big iterations of k

  • musaabuu Avatar

    for n = 46288, p = 5 4^5 + 6 ^ 6 + 2 ^ 7 + 8 ^ 8 + 8 ^ 9 = 151042752 --> 46288 * 69594204 but the challenge test says the output should be -1 how is that?

  • Azydayo Avatar

    Great challenge, the hardest thing was to understand the task

  • eymeter Avatar

    this was pain for a haskell beginner

  • Conc4ve H3ad Avatar

    I feel like I would have spent a lot less time with this if I wasn't a C++ beginner. I had fun, though. The concept is actually kind of simple, you just need to turn the fancy math language into something you can understand.

  • emanSameh Avatar

    what the hell was that

  • _INKI_ Avatar

    I hated this... Thanks! =D

  • stevelw Avatar

    Am I missing something - is this maths problem not unsolvable without placing limits on K, as you can always just look for higher values of K to infinity that meet this equation.

  • Enzooooooooooooooooo Avatar

    INSTRUCTIONS ARE UNCLEAR! I DO NOT LIKE THIS KATA, REMOVE IT FFROM THE WEBSITE, NOW!!!!

  • Christopher-C-Robinson Avatar

    I wish this wasnt so hard to grasp what was wanted to be accomplished. I hated reading this so many times lol.

  • etherusko Avatar

    There is an error in the examples in the description: n = 46288; p = 3 ---> 51 since 4³ + 6⁴+ 2⁵ + 8⁶ + 8⁷ = 2360688 = 46288 * 51 but 4³ + 6⁴+ 2⁵ + 8⁶ + 8⁷ = 263,592 So k=51 is wrong

  • jbg0801_2 Avatar

    a great challenge. Had to re-read a few times to get it, definitely got my brain going!

  • AlbertCarri Avatar

    I had to reread it many times to understand it, but I did it!

  • Abu_Camara Avatar

    This comment has been hidden.

  • ejini战神 Avatar

    This comment has been hidden.

  • khubilla Avatar

    Instruction is a bit vague. or maybe just me

  • Asael_Calizaya Avatar

    The tests assertions are not good, there are some expected results that are wrong, I figured it out when I test it manually with the given values.... not sure if I'm doing something wrong, could you please take a look at them?

  • JackUnicorn Avatar

    If you are struggling with understanding what k stands for it's the result of addition divided by initial number (n)

  • trashy_incel Avatar

    C fork

    • better assertion messages
    • tried to improve the description, also made it language-agnostic and removed the numerous per-language blocks
  • zhanssss Avatar

    I have stuck on one of the test and i cannot figure which values it gets when i call for funciton exactly this one "your solution should return -1, but it returned 3263.10819218804 instead." any ideas why I get it, or which values test passes to check my code? Thanks in advance

  • marnen Avatar

    In Haskell, this should probably use Nothing rather than -1 as a sentinel value.

  • Atharipro Avatar

    I am stuck, I have been trying to figure out the pattern for p. However, it just is not clicking for me. Any advice anyone?

  • akar-0 Avatar

    This comment has been hidden.

  • hiabed Avatar

    This comment has been hidden.

  • luch1n0z Avatar

    in my editor everything works correctly in the tests everything works, but then I get timed out, what should I do?

  • shini98 Avatar

    This comment has been hidden.

  • iVandalise Avatar

    All of the Sample cases are working but I'm getting some errors for the other test cases. I don't know what inputs are being given, it only says what integer is being supplied but not the power. Is there a way of seeing this?

  • Randombutton Avatar

    This comment has been hidden.

  • user5733715 Avatar

    This comment has been hidden.

  • DipakPrajapati Avatar

    "expected 3263.10819218804 to equal -1" what is the meaning of this message. all other test passed. please help. javascript used.

  • Mavludin1 Avatar

    expected -1 to equal 12933

    All tests pass, but there is this error, I don't understand what's the matter, help

  • kimtang Avatar

    fsharp has also problem

    at Microsoft.FSharp.Core.Operators+OperatorIntrinsics.loop@5444-5 (System.Int32 x, System.Int32 n) [0x00025] in <58dd0ce1dff9fae1a7450383e10cdd58>:0 at Microsoft.FSharp.Core.Operators+OperatorIntrinsics.PowInt32 (System.Int32 x, System.Int32 n) [0x00003] in <58dd0ce1dff9fae1a7450383e10cdd58>:0 at Microsoft.FSharp.Collections.ArrayModule.MapIndexed[T,TResult] (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] mapping, T[] array) [0x0002b] in <58dd0ce1dff9fae1a7450383e10cdd58>:0 at FSI_0001.digPow (System.Int32 n, System.Int32 p) [0x000af] in <0e31dce15f374339aca94f657f4daf5d>:0 at FSI_0001+Tests+suite@15.Invoke (Microsoft.FSharp.Core.Unit _arg1) [0x001c8] in <0e31dce15f374339aca94f657f4daf5d>:0 at Fuchu.Impl+evalTestList@260-1.Invoke (System.Tuple2[T1,T2] tupledArg) [0x00028] in <56a815db36d21f70a7450383db15a856>:0

  • Kevin9649 Avatar

    A little easy for a 6 kyu question. Perhaps it should be 7 kyu.

  • Ephemeridesh Avatar

    C++ It seems that the linker is unable to find the definition of the DigPow::digPow function, resulting in the "undefined reference" error.

    "/tmp/main-7834c7.o: In function dotest(int, int, int)': main.cpp:(.text+0xa): undefined reference to DigPow::digPow(int, int)' /tmp/main-7834c7.o: In function digPow_Tests::Fixed__Tests()': main.cpp:(.text._ZN12digPow_Tests12Fixed__TestsEv[_ZN12digPow_Tests12Fixed__TestsEv]+0x12): undefined reference to DigPow::digPow(int, int)' main.cpp:(.text._ZN12digPow_Tests12Fixed__TestsEv[_ZN12digPow_Tests12Fixed__TestsEv]+0x72): undefined reference to DigPow::digPow(int, int)' main.cpp:(.text._ZN12digPow_Tests12Fixed__TestsEv[_ZN12digPow_Tests12Fixed__TestsEv]+0xd2): undefined reference to DigPow::digPow(int, int)' main.cpp:(.text._ZN12digPow_Tests12Fixed__TestsEv[_ZN12digPow_Tests12Fixed__TestsEv]+0x132): undefined reference to `DigPow::digPow(int, int)' clang: error: linker command failed with exit code 1 (use -v to see invocation)"

  • lovelindhoni Avatar

    This comment has been hidden.

  • ejini战神 Avatar

    Actual and expected are swapped in PHP

  • astro-nova Avatar

    First read the task (a few times!) and missed that p is given, thought it was a much harder problem than it was :)

  • CS50Green Avatar

    My code is correct. But I'm running out of time. My code passes small test cases. But it fails BIG test cases. How can I fix this problem? Please! If anyone can help me! Thank You 🙏🙏🙏🙏

  • PGCL Avatar

    Hi I'm doing this project in C, locally I get all the cases and the answers correct, yet I get a time out. I assume it's because of my last loop where I try to find k. I haven't figured out how to make it more efficient. If anyone has a hint, I would appreciate it :)

  • sheepyturtle Avatar

    This just doesn't really seem like it's a very beginner friendly kata. When I selected that I was beginning to program, I wasn't expecting to have to do all of this kind of stuff. I wish Codewars had a better way of helping new programmers progress. I understand that I'll be doing a lot of research on how to solve these problems, and I'm fine with that, but a lot of the kata I've been given thus far, including this one, just don't seem like they'd be something a person who is new to programming with python would even know how to approach.

  • ojeriejire Avatar

    Option enum where?

  • IvanJijon Avatar

    This comment has been hidden.

  • avichii Avatar

    is there any efficiant way to code this! with time complexity of O(n)!

  • Piqueras Avatar

    Checks fail in Nim for some reason, check(false) is passed as a complete test but then it crashes

  • veyuron Avatar

    I solve it with SWIFT. All tests passed, but when attempting I received "expected -1 to equal 12933". What does it mean?

  • KrymsonScourge Avatar

    Could someone please explain the question in clearer detail for me?

  • cristian200504 Avatar

    This comment has been hidden.

  • KaterynaKunieva Avatar

    I solve it with JS. All tests passed, but when attempting I received "expected -1 to equal 12933". What does it mean?

  • rsschool_b658ef09880b9687 Avatar

    expected -1 to equal 1, what does it mean? my solution passes the test, but the task does not

  • rowcased Avatar

    This solution sometimes fails a random test.

  • JelinPro Avatar

    When calculating the length of a number, it would be a better idea to convert it to a string for manipulation

  • 0m04an Avatar

    The task is quite simple, the main thing is to clearly read the description and understand what each of the arguments does.

  • YasSer09 Avatar

    Nice Kata

  • Doug Colin Avatar

    Nice Kata, challenging but satisfying, without any pesky edge cases. Thanks!

  • tyler-mcdonald Avatar

    This comment has been hidden.

  • jvalenzu Avatar

    I definitely overthought (or rather underthought) this one - rereading the problem definition, the best solution was substantially simpler than my extremely roundabout attempt.

  • bklj Avatar

    If in the first test the result can be 1, doesen't that mean none could have output -1 since every number * 1 is the number itself. I don't know if I didn't get something right here from the instructions but I can't figure it out.

  • Axiomemath Avatar

    Hi, my code passed all the tests except the last one (when i try to attempt the code). wondering if someone was in the same situation! thanks

  • ojeriejire Avatar

    in rust it should probably return an Option

  • Saikoblade Avatar

    Is there a name to this math problem?

  • KayleighWasTaken Avatar

    Update to Scala 3

    Also modified the random test generator to actually include random tests.

  • Athimi  Avatar

    This comment has been hidden.

  • valentynder Avatar

    Didn't see any problems. Read the assignment carefully. Don't try to complicate.

  • YCodingS Avatar

    This comment has been hidden.

  • ChrisVIN Avatar

    This comment has been hidden.

  • StormyBoy Avatar

    This comment has been hidden.

  • Ulin Avatar

    I don't wanna do maths. Skip

  • ChiefAffirmationOfficer Avatar

    I think there may be an obscure issue with 32-bit math or floats going on here.

    When I found that my solution was failing only a very small number of unit tests in the full test suite, I suspected an edge case, and, on a hunch, made only one change: I replaced the multiplication operator (*) with Math.imul() (see https://mdn.io/imul). This passed all the tests.

    I have verified this behavior occurs both in Node v10.x and in Node v8.1.3, so I don't believe this to be a newer phenomenon, and may suggest issues in other languages beyond JavaScript.

  • mamun111 Avatar

    This comment has been hidden.

  • malmsteadaa Avatar

    This comment has been hidden.

  • DN20 Avatar

    p and k are the same value? i'm confused. promt is confusing.

  • ungarscool1 Avatar

    It does not compile in Typescript

    test.ts:5:35 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'void'.

    5 assert.equal(G964.digPow(n, p), expected, "Incorrect answer for n=" + n + ", p=" + p);

  • Morze_scharp Avatar

    src/Solution.cs(19,2): error CS1513: } expected 1^2+9^3=1+729=730/19 = 38.421

    answer: -1 The answer given: no -1

  • NicoCastelnuovo Avatar

    Hi, I'm trying to understand what doesn't work in my code, but I can't get it. Actually it works with all the cases, except the biggest cases (until I can see), that is n = 3456789 and p = 5. Any tipp?

  • e1_dune Avatar

    This comment has been hidden.

  • adamschricker Avatar

    This comment has been hidden.

  • dfhwze Avatar

    COBOL: sample tests don't work. Incorrect PIC type used for 'n'.

  • akar-0 Avatar
  • jordanfox1 Avatar

    I think in the description where you say "such as", you are meaning to say "such that". You may want to change it for clarity.

  • Kayden99 Avatar

    This comment has been hidden.

  • freestyle09 Avatar

    Tests are green but I cannot submit the solution because 3263 should be -1 and if I run this locally I am getting -1 from 3263. Please fix this

  • creign Avatar

    I believe in terms of the problem: k such as : (a ^ p + b ^ (p+1) + c ^(p+2) + d ^ (p+3) + ...) = n * k A few tests are invalid mathimatically. This is because we are expected to work with int & long when certain sets produce decimal place values which meet the criteria. The solution at the moment is to stick with whole numbers when calculating and dismiss fractional calculations. I think maybe either this needs to be explicitly outlined in the problem or fractional tests should be removed.

  • JavaKid Avatar

    Pass TEST but fail ATTEMPT. How it possible: n = 46288 result = 51 sum = 2360688 startPower = 3 // Pass during TEST n = 46288 result = 51 sum = 2360688 startPower = 3 // Fail during ATTEMPT expected 51 to equal -1

  • Trambalda Avatar

    Why 403 with initial pow 1 expecting -1? 4pow1 + 0pow2 + 3pow3 = 31 31 * 13 = 403

  • arnav7633 Avatar

    On attempted the kata is wrongly expecting a -1 for 46288 as n and 5 as p, my code works for all other cases but not that one specifically

  • rrgomide Avatar

    This comment has been hidden.

  • MorganFlam Avatar

    Hi, I'm at lost. My code works as expected in VSC but when I test it here, I get an error "Expected 1 got nil". Anybody with an idea as to what I'm not doing properly ?

  • Minotauer Avatar

    This comment has been hidden.

  • user750857 Avatar

    No random tests.

  • tinidril Avatar

    I initially didn't see that the value of p was provided as a paramater, so I ran my code to find any solution while p<1000 and discovered that some of the test examples incorrectly expect a -1 return (or no solution) when I found a whole intager solution to the given n value as the instructions request.

  • rostovao Avatar

    This comment has been hidden.

  • yurk1n Avatar

    This comment has been hidden.

  • BAXYCoding Avatar

    boost isn't available, but its included by default on the kata when using cpp. Any alternative libraries I could use?

  • fredericoo Avatar

    Man, javascript is very legible. Three-liner that actually is super easy to read and understand.

  • vsukarieh Avatar

    using C# i am getting this error. code work fine on Visual studion on my local machine. i googled it but it seems to be something concerning namespaces but i cant pin it down. any ideas? src/Solution.cs(11,28): error CS0103: The name 'Math' does not exist in the current context

  • vsukarieh Avatar

    it gave me an error while using c# it didnt recognize Math.Pow() solution worked on my local machine just fine

  • 4or Avatar

    How do we determine the value of p ?

  • Alaa Alsayed Avatar

    This comment has been hidden.

  • carlosgsmith Avatar

    y does the compiler throw an error for ArrayList list = new ArrayList<>(); ?

  • RajasB Avatar

    This comment has been hidden.

  • LVL?DEATH Avatar

    This comment has been hidden.

  • jpchato Avatar

    I cannot figure out how to calculate k.

  • zgondal Avatar

    This comment has been hidden.

  • parthanjaria Avatar

    Why does it give tis error : error: unresolved reference: pow sum += (listOfNumbers[i].toDouble().pow(p + i))

    I am trying to use the "pow" funtion. why does it say unresolved reference: pow?

  • Coopsec Avatar

    This comment has been hidden.

  • mati87 Avatar

    Hello Community,

    When I do the tests I pass them all. When I submit the code I pass most of them except 3. I thought the problem was that the value of n were floats and I adjust the code accordingly. However I keep getting the same errors. When I run the code in my computer with those values, assuming the values are referring to n, my code works just fine.

    Any hints?

    3263.10819218804 should equal -1 1.464758190332126 should equal -1 9400.896936434361 should equal -1

  • Ada-develop Avatar

    This comment has been hidden.

  • dinglemouse Avatar

    For C (probably others)... the Kata description says nothing about the input except that n and p will always be given as strictly positive integers., but given some large n and large p IMO this kind of algorithm could easily overflow just trying to figure the sum. The description should say not to worry about overflow because the input will always be kept to some sane values.

  • nichtBruno Avatar

    This comment has been hidden.

  • sandeepmnani Avatar

    I have passed all the test casess except for the 4th test . the output says :-1 should equal 9

    Is there any way to know the parameteres passed to the function for this test. It my help me to resolve the issue.

    Any inforamtion is much appreceiated. Thanks in advance

  • Fracture Avatar

    This teaches some valuable lessons. Unfortunately, it seemed to be primarily through frustration. Not the best teaching method. Some more rounded sample tests hinting at the esoteric quirks being highlighted would be a large improvement. Where there is a whip there is a way, but gentle encouragement is a better choice IMHO.

  • ghaziblack Avatar

    probleme with submitting my code

  • ben2000tan Avatar

    This comment has been hidden.

  • evilhaxor Avatar

    Made it in 72 chars. Can some one do it shorter?

  • Precius Avatar

    I honestly don't understand where the problem is? If I have to learn something and I show the code someone should tell me where the problem is, or I have to waste time hours and hours and not understand anyway what I'm doing wrong... maybe here is too advanced for me

  • Omkar3007 Avatar

    I am getting all correct answers in terminal but still all cases failed . Can someone help (Using Python)

  • Chubbyking123 Avatar

    This comment has been hidden.

  • Jillsea Avatar

    This comment has been hidden.

  • iptcyq Avatar

    I'm playing around with digits ;) but I always seem to have an error with the line: 'number = Convert.ToInt32(str);', even though other katas and pages show that this is a correct line for c# code to convert text to integer. I believe its the last error I have but I can't seem to solve it. Could anyone help? Thanks! (Error: The name 'Convert' does not exist in the current context)

  • jiaweitxng Avatar

    nice kata!

  • jlangson Avatar

    This comment has been hidden.

  • bkf Avatar

    This comment has been hidden.

  • AndrewDales Avatar

    This comment has been hidden.

  • Kishan@124 Avatar

    This comment has been hidden.

  • Chrono79 Avatar

    The example which expects -1 should be like this: digPow(92, 1) should return -1 since there is no k such as 9p + 2p+1 equals 92 * k

  • hisham/hisham Avatar

    This comment has been hidden.

  • marabunta62 Avatar

    This comment has been hidden.

  • HandsomeHandsCrab Avatar

    This comment has been hidden.

  • kue_pancake Avatar

    anyone who have trouble to solve this kata you are not dumb,read the desc again and again. i believe youll fin your AHA moment

  • vproper Avatar

    error: expected 'in' after for-each pattern for res=0 don't use "for" when trying to pass parameters in Swift, otherwise tests won't work

  • Azttek Avatar

    This comment has been hidden.

  • CMEXOTPOH Avatar

    And I was playing with digits And I didn't know what it meant.

  • Ishan Srivastava Avatar

    I dont know how to resolve the runtime error my code is working fine in my machine but when i test it in the webpage it is showing runtime error btw im using c

  • dmcnasci Avatar

    This comment has been hidden.

  • Vivek_Chotaliya Avatar

    While I test- it shows "All tests Passed", but when I attempt, it shows error in 5th. All above 4 are shown as passed. Can anyone guide me what's wrong here? (code writen in C)

  • zhangzhentao Avatar

    请问一下测试用例12933的问题怎么解决,我搞不定! expect12933,but was-1;

  • Greyside Avatar

    Failed Test 5, 14, and 15. Each one is expecting -1 to be returned. I got 3263 for Test 5, 1 for Test 14, and 9400 for Test 15. If someone that finished and has the test cases can steer my in the right direction I'd appreciate it!

  • oahmadseecs Avatar

    the range of N is not given, how am I supposed to find out how many digits are there in n?

  • apurbu-sarder-apu Avatar

    How can i solved!

  • eftichis Avatar

    This comment has been hidden.

  • DziadekRobert Avatar

    I got an headache reading own code lol

  • ayenir Avatar

    I am horrble at writing "Pythonic" code. Everyone else's solution is much more elegant and short.

  • Adr0it Avatar

    I can't believe I solved this, lol.

  • moha_linus Avatar

    This comment has been hidden.

  • sallihin Avatar

    When I first read the question, I thought there was no way this is a 6kyu. Took me a couple of tries before I realise I'm not searching for a pattern and that p is given.

  • PotatoSunday Avatar

    I passed 29 test and failed 3.

    I don't know what I am doing wrong. It says something like the result should not be -1.

    I believe my code is correct on the part that returns -1. I don't know what is wrong.

  • mike-tad Avatar

    why the first test are freaking hard!

  • Jorge Ojeda Avatar

    I found that there is a mistake in the last two test you put up. dotest(46288, 3, 51); dotest(114, 3, 9); 51 and 9 are not valid results !!

    Thanks, Jorge

  • hassan.amg Avatar

    hi please how can i convert each char in a string into integer ?

  • DiogenesOfMiami Avatar

    -1 should equal 12933

  • hollow_knight Avatar

    This comment has been hidden.

  • Nabil19911 Avatar

    Hwo to find K????

  • Avtomatk Avatar

    In my compiler (c language) i get the results for all tests: result: 1, expected: 1 result: -1, expected: -1 result: 51, expected: 51 result: 9, expected: 9

    I pass the first test, but at atempt: passed: 9, failed: 1?? what the hell is going on... i reviewed my code 10 times, i dont have logic nor sintactic errors.

  • agressivess Avatar

    Why cant i use Math.Pow in C#? whats the problem

  • wenzwen Avatar

    This comment has been hidden.

  • IntuCode Avatar

    Nice solid kata.

  • blackhood Avatar

    Time: 758ms Passed: 31 Failed: 1 Exit Code: 1 JavaScript

    I don't know what is happening with the last test :(

  • thexyspace Avatar

    This comment has been hidden.

  • user8789428 Avatar

    I have a solution using C that works when compiling on my computer, yet it's marked as incorrect when submitting it on codewars. Particularly for the tests n = 46288 and p = 3 and n = 114 and p = 3. I have checked on my computer that it returns the correct answers, but the codewars tests signals it returns -1. My solution used the <math.h> library and is recursive, could this have something to do with my code not working on codewars?

  • jambalayadog Avatar

    Are there not some standards for describing problems?

    After reading the problem and pondering for a few minutes, I immediately came to discussion to see if there was any good discussion on articulating the problem more clearly.

    My primary issue with the write up is that there are 'leaps' between each of the sections, and it's not clear what the leaps are because of the way the problem is organized.

    Basically, I felt dumber for reading the problem. And now that I understand the problem, I didn't have an 'aha epiphany'. I had an epiphany that the problem is poorly constructed.

  • ccardiff Avatar

    My solution (JavaScript) worked but it says it took too long and I need to optimize it. I am so new to this I don't know where to start to make it run faster; anyone have a good (beginner-friendly) resource they'd like to recommend?

  • GLeb1507 Avatar

    This comment has been hidden.

  • Crysteier Avatar

    Hi,in Javascript I think there is problem with the testing because when I press attempt all the tests are good except for one. The number 135. In the log it awaits a -1 but it should expect a 1 because 1^1+3^2+5^3=135 and so 135/135=1 so I have no idea why it is expecting a -1. Also for some reason my code returns a 51 on this exact number. Even tough when I console.log it it shows a 1 so what is happening here?

  • Mello.J Avatar

    This comment has been hidden.

  • denteh Avatar

    This comment has been hidden.

  • denteh Avatar

    I am having difficulty in solving this problem Passed: 29 Failed: 3 Exit Code: 1

    3263 should equal -1 1 should equal -1 9400 should equal -1 I am running the codes in python

  • snake_charmer Avatar

    When solving katas like this one, I see many people using strings, which generally results in a shorter and maybe more pythonic code. I try to solve the problem mathematically, ie integers stay integers throughout and performing the needed operations on them. I'm more concerned with style rather than performance, and would like to read some opinions and recommendations.

  • StathisK Avatar

    This comment has been hidden.

  • Molaij Avatar

    This comment has been hidden.

  • BavarianAT Avatar

    This comment has been hidden.

  • Rud1 Avatar

    This comment has been hidden.

  • Dibyaman Chakraborty Avatar

    Time: 1067ms Passed: 2 Failed: 1 Exit Code: 1 Test Results: digPow ShouldPassAllTheTestsProvided Test Passed Test Passed The expression (act) == (exp) is false. Completed in 0.8660ms Log Error. Expected 51 but got -1 Completed in 0.8660ms

  • miguelcmaramara Avatar

    I'm having a bit of a problem with my code. I keep getting this error!

    UndefinedBehaviorSanitizer:DEADLYSIGNAL ==1==ERROR: UndefinedBehaviorSanitizer: FPE on unknown address 0x000000427cdc (pc 0x000000427cdc bp 0x7ffd6868e1d8 sp 0x7ffd6868dd90 T1) ==1==WARNING: invalid path to external symbolizer! ==1==WARNING: Failed to use and restart external symbolizer! #0 0x427cdb (/workspace/test+0x427cdb) #1 0x42660e (/workspace/test+0x42660e) #2 0x426192 (/workspace/test+0x426192) #3 0x425d4b (/workspace/test+0x425d4b) #4 0x42a085 (/workspace/test+0x42a085) #5 0x42546d (/workspace/test+0x42546d) #6 0x7f3116f71b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #7 0x4043e9 (/workspace/test+0x4043e9)

    UndefinedBehaviorSanitizer can not provide additional info. ==1==ABORTING

  • zodder Avatar

    Does anyone know how to handle the last test? "12932 should equal 12933" dont really understand where I meesed up in the code...

  • user510427 Avatar

    This comment has been hidden.

  • jesusdesk Avatar

    When I test my code, it work perfectly, all the tests were approved, but when I try to attempt my code, then it throws another test I supose, it says "The expression (act) == (exp) is false." the output windows looks like this:

    Test Results: digPow ShouldPassAllTheTestsProvided Test Passed Test Passed Test Passed Test Passed The expression (act) == (exp) is false. Completed in 231.5164ms Log Error. Expected -1 but got 69594204

    I dont know why

  • p37rov.nvkz Avatar

    Passed: 29 Failed: 3 Exit Code: 1

    3263 should equal -1 1 should equal -1 9400 should equal -1

    How to see the full list of tests? I can’t understand what start with which parameters led to the error.

  • socrates13 Avatar

    This comment has been hidden.

  • E11even11 Avatar

    This comment has been hidden.

  • E11even11 Avatar

    This comment has been hidden.

  • user1130392 Avatar

    This comment has been hidden.

  • sriharshachilakapati Avatar

    @g94 I have made a PureScript translation. Please take a look.

  • Focus0 Avatar

    This comment has been hidden.

  • Aliervo Avatar

    A suggestion to help clarify the description:

    "We are looking for a number, k, that when muliplied by the input, n, is equal to the sum of it's constituent digits, a, b, c, ..., raised to consecutive powers starting at p."

    Then add "where a, b, c, d, ... are the digits that make up n" to the end of the "other words" portion.

    The current wording does contain all the info needed to solve the problem, but I (and many others judging from the comments) had trouble figuring out what was required initially. I think adding a few choice words like in my suggestion would help clear things up a little.

  • David3019 Avatar

    I run my code in a separate IDE and it works. For example, dig_pow(46288, 3) will return 51 in my IDE, but not here. Can someone help?

  • krsfvde Avatar

    This comment has been hidden.

  • Rajneel Bharali Avatar

    This comment has been hidden.

  • Good O-man Avatar

    This comment has been hidden.