{"id":24056237,"url":"https://github.com/arjun1237/diagonaldifference","last_synced_at":"2025-09-02T22:42:57.918Z","repository":{"id":110875075,"uuid":"144782979","full_name":"arjun1237/DiagonalDifference","owner":"arjun1237","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-14T23:47:47.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T05:00:42.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arjun1237.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-14T23:43:04.000Z","updated_at":"2018-08-14T23:47:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"afb8abe1-ab8f-4c99-8bda-5919f19d15cf","html_url":"https://github.com/arjun1237/DiagonalDifference","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2FDiagonalDifference","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2FDiagonalDifference/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2FDiagonalDifference/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2FDiagonalDifference/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjun1237","download_url":"https://codeload.github.com/arjun1237/DiagonalDifference/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240849057,"owners_count":19867617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T05:00:21.862Z","updated_at":"2025-02-26T12:13:43.715Z","avatar_url":"https://github.com/arjun1237.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiagonalDifference\n\nProblem is from link: https://www.hackerrank.com/challenges/diagonal-difference/problem\n\n\nGiven a square matrix, calculate the absolute difference between the sums of its diagonals.\n\nFor example, the square matrix  is shown below:\n\n1 2 3\n4 5 6\n9 8 9  \nThe left-to-right diagonal = . The right to left diagonal = . Their absolute difference is .\n\nFunction description\n\nComplete the  function in the editor below. It must return an integer representing the absolute diagonal difference.\n\ndiagonalDifference takes the following parameter:\n\narr: an array of integers .\nInput Format\n\nThe first line contains a single integer, , the number of rows and columns in the matrix . \nEach of the next  lines describes a row, , and consists of  space-separated integers .\n\nConstraints\n\nOutput Format\n\nPrint the absolute difference between the sums of the matrix's two diagonals as a single integer.\n\nSample Input\n\n3\n11 2 4\n4 5 6\n10 8 -12\nSample Output\n\n15\nExplanation\n\nThe primary diagonal is:\n\n11\n   5\n     -12\nSum across the primary diagonal: 11 + 5 - 12 = 4\n\nThe secondary diagonal is:\n\n     4\n   5\n10\nSum across the secondary diagonal: 4 + 5 + 10 = 19 \nDifference: |4 - 19| = 15\n\nNote: |x| is the absolute value of x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun1237%2Fdiagonaldifference","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjun1237%2Fdiagonaldifference","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun1237%2Fdiagonaldifference/lists"}