• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
sv90 Avatar
Name:Unknown
Clan:Unknown
Member Since:Nov 2014
Last Seen:May 2025
Profiles:
    Following:2
    Followers:12
    Allies:1
    View Profile Badges
    Ad
    Would You Pass the Google SQL Interview? Test Yourself with These 7 Concepts
    Study up for your next SQL interview with these interview questions.
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations
    • Replies (29)
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • manikaran
      • commented on "Build a pile of Cubes" cpp solution
      • 3 years ago

      This comment is hidden because it contains spoiler information about the solution

    • Custom User Avatar
      • BNM-9000
      • commented on "Esolang Interpreters #1 - Introduction to Esolangs and My First Interpreter (MiniStringFuck)" kata
      • 5 years ago

      Einstellung Effect

    • Custom User Avatar
      • osamakawish
      • commented on "Build a pile of Cubes" cpp solution
      • 5 years ago

      This comment is hidden because it contains spoiler information about the solution

    • Custom User Avatar
      • dcieslak
      • commented on "Digital cypher" kata
      • 7 years ago

      Thanks! It's already approved :)

    • Custom User Avatar
      • Chrono79
      • commented on "Calculate the area of a regular n sides polygon inside a circle of radius r" kata
      • 8 years ago

      I've lowered the radius values for C++ random tests, could you try again?

    • Custom User Avatar
      • Voile
      • commented on "Calculate the area of a regular n sides polygon inside a circle of radius r" kata
      • 8 years ago

      If you're printing doubles in scientific form you should print it to at least 15 digits or something. 6 digits is far from enough to resolve tiny differences.

    • Custom User Avatar
      • Chrono79
      • commented on "Calculate the area of a regular n sides polygon inside a circle of radius r" kata
      • 8 years ago

      Rounding function seems ok, maybe the problem is in the rest of your code. I agree the error message isn't helpful in that case.

    • Custom User Avatar
      • Blind4Basics
      • commented on "Chess Fun #1: Chess Board Cell Color" c solution
      • 8 years ago

      but the spoiler flag is... :p (comments visible in the dashboard of anyone)

    • Custom User Avatar
      • anter69
      • resolved a suggestion on "Write your own map function." kata
      • 8 years ago

      Description updated.

    • Custom User Avatar
      • ice1000
      • commented on "Naive subarray" kata
      • 8 years ago

      Many thanks! I've done the changes.

    • Custom User Avatar
      • foreveryoung
      • commented on "Naive subarray" kata
      • 8 years ago

      "delete &" is not what you want, the & makes no sense there.
      The memcpy code is also wrong. You are only copying 1000 bytes, not 1000 ints.
      Much simpler:

      It(should_work_for_random_tests_n_1000_An_10000) {
              srand((unsigned)time(NULL));
              cout << "<p><font color=\"blue\">n == 1000, a[n] <= 10000</font></p>" << endl;
              int count = 3;
              while (count--) {
                  std::array<int, 1000> array;
                  for (auto i = 0; i < 1000; ++i)
                      array[i] = rand() % 10000;
                  Assert::That(don't see this!);
              }
          }
      

      And should you need a copy you can then simply:

      std::array<int, 1000> array2 = array;
      
    • Custom User Avatar
      • ice1000
      • commented on "Naive subarray" kata
      • 8 years ago

      Any idea about this problem? (I've rewritten the tests using std::array)

      My code:

      	It(shoud_work_for_random_tests_n_1000_An_10000) {
      		srand((unsigned)time(NULL));
      		cout << "<p><font color=\"blue\">n == 1000, a[n] <= 10000</font></p>" << endl;
      		int count = 3;
      		while (count --> 0) {
      			auto array = new int[1000]();
      			for (auto i = 0; i < 1000; ++i)
      				array[i] = rand() % 10000;
      			auto _ = *new std::array<int, 1000>();
      			memcpy(_.data(), array, 1000);
      			Assert::That(don't see this!);
      			delete array;
      			delete &_;
      		}
      	}
      

      Which is raising:

      Process exited prematurely with a SIGSEGV signal.

    • Custom User Avatar
      • ice1000
      • commented on "Naive subarray" kata
      • 8 years ago

      Thanks again for your suggestion and help! :D

    • Custom User Avatar
      • ice1000
      • commented on "Naive subarray" kata
      • 8 years ago

      Shit, the edited codes are lost. Maybe I should try to rewrite one tomorrow. It's 0:00 a.m. in my timezone. I have to sleep.

    • Custom User Avatar
      • ice1000
      • commented on "Naive subarray" kata
      • 8 years ago

      I'll try, thanks

    • Loading more items...
    • © 2025 Codewars
    • About
    • API
    • Blog
    • Privacy
    • Terms
    • Code of Conduct
    • Contact

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...