• 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
CRYPTON Avatar
Name:NIKOLA NIKOLIC
Clan:Informatic in Engineering | Faculty of Engineering Kragujevac
Skills:javascript | php
Member Since:Dec 2017
Last Seen:Jul 2025
Profiles:
Following:22
Followers:9
Allies:2
View Profile Badges
Ad
Educator, struggling to assess your students?
Assess your classroom or bootcamp with the world leading assessment platform, Qualified.Request your demo today!
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (86)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • trashy_incel
    • resolved an issue on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 4 months ago

    done

  • Custom User Avatar
    • ejini战神
    • created an issue for "Principal Diagonal | VS | Secondary Diagonal" kata
    • 4 months ago

    Java:

    • Missing fixed tests

    • Should be upgraded to JUnit5

    • Reference solution should be private

  • Custom User Avatar
    • hobovsky
    • resolved an issue on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 5 months ago

    Fixed.

  • Custom User Avatar
    • hobovsky
    • resolved a suggestion on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 5 months ago

    Merged.

  • Custom User Avatar
    • trashy_incel
    • resolved a suggestion on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 10 months ago

    fixed

  • Custom User Avatar
    • hobovsky
    • commented on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 10 months ago

    For the record, OPs wrong solution is:

    public class Solution{
      public static String diagonal(int[][] matrix){
        System.out.println(matrix[0][0]+" "+matrix[0][1]+" "+matrix[0][2]);
                System.out.println(matrix[1][0]+" "+matrix[1][1]+" "+matrix[1][2]);
                System.out.println(matrix[2][0]+" "+matrix[2][1]+" "+matrix[2][2]);
                System.out.println(matrix[0][0] + matrix[2][2] > matrix[0][2] + matrix[2][0] ? "Principal Diagonal win!" :
              matrix[0][0] + matrix[2][2] < matrix[0][2] + matrix[2][0] ? "Secondary Diagonal win!" : "Draw!");
        return matrix[0][0] + matrix[2][2] > matrix[0][2] + matrix[2][0] ? "Principal Diagonal win!" :
              matrix[0][0] + matrix[2][2] < matrix[0][2] + matrix[2][0] ? "Secondary Diagonal win!" : "Draw!";
      }
    }
    

    Example input it fails is:

    matrix = [
      [1, 6, 1, 4, 9]
      [7, 2, 6, 2, 9]
      [1, 4, 8, 6, 5]
      [1, 6, 0, 1, 4]
      [1, 2, 5, 4, 1]
    ]
    
  • Custom User Avatar
    • hobovsky
    • resolved an issue on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 10 months ago

    Your solution is shit broken, it can handle only matrices of size 3x3. It returns wrong result for matrices larger than 3x3.

    Not a kata issue.

  • Custom User Avatar
    • Norris4
    • created an issue for "Principal Diagonal | VS | Secondary Diagonal" kata
    • 10 months ago

    Shit ain't working

    5 0 4
    9 2 0
    3 6 4
    Principal Diagonal win!

    right? according to the rules, it is. according to the random tests, secondary wins here though...

  • Custom User Avatar
    • MLYTC1
    • commented on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 10 months ago

    cool

  • Custom User Avatar
    • cwps
    • created a suggestion for "Principal Diagonal | VS | Secondary Diagonal" kata
    • 10 months ago

    PHP fork to fix this issue and enable PHP 8.

  • Custom User Avatar
    • saudiGuy
    • created an issue for "Principal Diagonal | VS | Secondary Diagonal" kata
    • 2 years ago

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

  • Custom User Avatar
    • saudiGuy
    • created a suggestion for "Principal Diagonal | VS | Secondary Diagonal" kata
    • 2 years ago

    python new test framework is required. updated in this fork

  • Custom User Avatar
    • ejini战神
    • resolved a suggestion on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 2 years ago

    Current state of C++ initial solution setup compiles correctly, closing!

  • Custom User Avatar
    • ejini战神
    • resolved a question on "Principal Diagonal | VS | Secondary Diagonal" kata
    • 2 years ago

    OP solved it, closing

  • Custom User Avatar
    • cosenocs
    • commented on "Find the smallest integer in the array" php solution
    • 2 years ago

    And you're starting with $arr[0], so in your loop you can skip first element by starting to count from $i = 1.

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...