{"id":3291,"date":"2025-01-20T08:04:55","date_gmt":"2025-01-20T08:04:55","guid":{"rendered":"https:\/\/gnomeledge.com\/QH2301B\/?p=3291"},"modified":"2025-01-20T08:04:56","modified_gmt":"2025-01-20T08:04:56","slug":"hackerrank-tutorial-12-diagonal-difference-challenge","status":"publish","type":"post","link":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/","title":{"rendered":"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge"},"content":{"rendered":"\n<p><strong>Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.<\/strong>\u00a0<strong>Ref:\u00a0<a href=\"https:\/\/www.hackerrank.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.hackerrank.com\/<\/a><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"489\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_1-1024x489.jpg\" alt=\"\" class=\"wp-image-3293\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_1-1024x489.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_1-300x143.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_1-768x367.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_1-1536x734.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_1.jpg 1918w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 2 \u2013 Click into \u201cContinue Preparation\u201d under Problem Solving. Choose \u201cDiagonal Difference\u201d Challenge.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_2-1024x495.jpg\" alt=\"\" class=\"wp-image-3294\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_2-1024x495.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_2-300x145.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_2-768x371.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_2-1536x743.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_2.jpg 1901w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 3 \u2013 Read the Instructions Carefully.<\/strong><\/p>\n\n\n\n<p>Change the&nbsp;<strong>Programming Language to Python 3<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"493\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_3-1024x493.jpg\" alt=\"\" class=\"wp-image-3295\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_3-1024x493.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_3-300x145.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_3-768x370.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_3-1536x740.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_3.jpg 1907w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 4 \u2013 List the Requirements and Constraints in a Notepad\/Drawing board in simple words. Learn to take notes.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"646\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_4-1024x646.jpg\" alt=\"\" class=\"wp-image-3296\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_4-1024x646.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_4-300x189.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_4-768x484.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_4-1536x969.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_4.jpg 1644w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>For this problem, it is best to draw it out to visualise what it is asking you to solve.<\/p>\n\n\n\n<p>You are supposed to ensure the diagonal columns of the grid is extracted for adding up.<\/p>\n\n\n\n<p>The first and second diagonals&#8217; sum of numbers will be subtracted against each other.<\/p>\n\n\n\n<p>Due to the requirement of absolute difference, we only take the absolute value of the result of the subtraction. The positive or negative aspect of the diagonals&#8217; sum is not a concern.<\/p>\n\n\n\n<p><strong>Step 5 \u2013 Convert What You Understand of the&nbsp;Requirements and Constraints&nbsp;into code<\/strong>.<\/p>\n\n\n\n<p>Convert the logic into code as below&#8217;s screenshoot.<\/p>\n\n\n\n<p>Note that it was declared initially that <strong>arr <\/strong>was listed in <strong>Functional Description <\/strong>as an array of integer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"885\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_5-1024x885.jpg\" alt=\"\" class=\"wp-image-3297\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_5-1024x885.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_5-300x259.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_5-768x664.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_5.jpg 1060w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 6 \u2013 Click \u201cRun Code\u201d to Test Your Code. Do Note if you submit code with errors, you will lose points. So \u201cRun Code\u201d first to ensure everything works.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"671\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_6-1024x671.jpg\" alt=\"\" class=\"wp-image-3298\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_6-1024x671.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_6-300x197.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_6-768x503.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_6.jpg 1045w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 7 \u2013 Once you have tested that your code works, \u201cSubmit Code\u201d to clear the challenge and earn some Hacker points.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"847\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_7-1024x847.jpg\" alt=\"\" class=\"wp-image-3299\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_7-1024x847.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_7-300x248.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_7-768x635.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT8_7.jpg 1052w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.\u00a0Ref:\u00a0https:\/\/www.hackerrank.com\/ Step 2 \u2013 Click into \u201cContinue Preparation\u201d under Problem Solving. Choose \u201cDiagonal Difference\u201d Challenge. Step 3 \u2013 Read the Instructions Carefully. Change the&nbsp;Programming Language to Python 3. Step 4 \u2013 List the Requirements and Constraints in a Notepad\/Drawing board in simple words. Learn to take [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[374,360,365,370,3,256,174,366,8,371],"tags":[],"class_list":["post-3291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-algorithms-problem-solving","category-ambition","category-competitive-programming","category-hackerrank","category-ite","category-learning-through-experimentations","category-methods-and-techniques","category-ranking-up","category-student-support","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge - Gnome Ledge<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge - Gnome Ledge\" \/>\n<meta property=\"og:description\" content=\"Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.\u00a0Ref:\u00a0https:\/\/www.hackerrank.com\/ Step 2 \u2013 Click into \u201cContinue Preparation\u201d under Problem Solving. Choose \u201cDiagonal Difference\u201d Challenge. Step 3 \u2013 Read the Instructions Carefully. Change the&nbsp;Programming Language to Python 3. Step 4 \u2013 List the Requirements and Constraints in a Notepad\/Drawing board in simple words. Learn to take [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\" \/>\n<meta property=\"og:site_name\" content=\"Gnome Ledge\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-20T08:04:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-20T08:04:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Wei Jing HO\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wei Jing HO\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\"},\"author\":{\"name\":\"Wei Jing HO\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5\"},\"headline\":\"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge\",\"datePublished\":\"2025-01-20T08:04:55+00:00\",\"dateModified\":\"2025-01-20T08:04:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\"},\"wordCount\":229,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#organization\"},\"image\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp\",\"articleSection\":[\"Algorithms \/ Problem Solving\",\"Ambition\",\"Competitive Programming\",\"HackerRank\",\"ITE\",\"Learning through Experimentations\",\"Methods and Techniques\",\"Ranking Up\",\"Student Support\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\",\"name\":\"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge - Gnome Ledge\",\"isPartOf\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp\",\"datePublished\":\"2025-01-20T08:04:55+00:00\",\"dateModified\":\"2025-01-20T08:04:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp\",\"contentUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/gnomeledge.com\/QH2301B\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#website\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/\",\"name\":\"Gnome Ledge\",\"description\":\"Seekers of Knowledge\",\"publisher\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#organization\"},\"alternateName\":\"Class QH2301B\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gnomeledge.com\/QH2301B\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#organization\",\"name\":\"Gnome Ledge\",\"alternateName\":\"Class QH2301B\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png\",\"contentUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png\",\"width\":40,\"height\":67,\"caption\":\"Gnome Ledge\"},\"image\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/averageone.com\/\",\"https:\/\/www.linkedin.com\/in\/howeijing-wr\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5\",\"name\":\"Wei Jing HO\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g\",\"caption\":\"Wei Jing HO\"},\"sameAs\":[\"https:\/\/averageone.com\/\"],\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/author\/mr-ho\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge - Gnome Ledge","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/","og_locale":"en_US","og_type":"article","og_title":"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge - Gnome Ledge","og_description":"Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.\u00a0Ref:\u00a0https:\/\/www.hackerrank.com\/ Step 2 \u2013 Click into \u201cContinue Preparation\u201d under Problem Solving. Choose \u201cDiagonal Difference\u201d Challenge. Step 3 \u2013 Read the Instructions Carefully. Change the&nbsp;Programming Language to Python 3. Step 4 \u2013 List the Requirements and Constraints in a Notepad\/Drawing board in simple words. Learn to take [&hellip;]","og_url":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/","og_site_name":"Gnome Ledge","article_published_time":"2025-01-20T08:04:55+00:00","article_modified_time":"2025-01-20T08:04:56+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp","type":"image\/webp"}],"author":"Wei Jing HO","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wei Jing HO","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#article","isPartOf":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/"},"author":{"name":"Wei Jing HO","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5"},"headline":"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge","datePublished":"2025-01-20T08:04:55+00:00","dateModified":"2025-01-20T08:04:56+00:00","mainEntityOfPage":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/"},"wordCount":229,"commentCount":0,"publisher":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#organization"},"image":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage"},"thumbnailUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp","articleSection":["Algorithms \/ Problem Solving","Ambition","Competitive Programming","HackerRank","ITE","Learning through Experimentations","Methods and Techniques","Ranking Up","Student Support","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/","url":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/","name":"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge - Gnome Ledge","isPartOf":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage"},"image":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage"},"thumbnailUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp","datePublished":"2025-01-20T08:04:55+00:00","dateModified":"2025-01-20T08:04:56+00:00","breadcrumb":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#primaryimage","url":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp","contentUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-20-15.55.39-A-playful-3x3-tic-tac-toe-board-filled-with-cute-creatures-instead-of-traditional-Xs-and-Os.-Each-square-is-occupied-by-an-adorable-animal-such-as-ch.webp","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/20\/hackerrank-tutorial-12-diagonal-difference-challenge\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gnomeledge.com\/QH2301B\/"},{"@type":"ListItem","position":2,"name":"[HackerRank] Tutorial 12:\u00a0\u201cDiagonal Difference\u201d Challenge"}]},{"@type":"WebSite","@id":"https:\/\/gnomeledge.com\/QH2301B\/#website","url":"https:\/\/gnomeledge.com\/QH2301B\/","name":"Gnome Ledge","description":"Seekers of Knowledge","publisher":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#organization"},"alternateName":"Class QH2301B","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gnomeledge.com\/QH2301B\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gnomeledge.com\/QH2301B\/#organization","name":"Gnome Ledge","alternateName":"Class QH2301B","url":"https:\/\/gnomeledge.com\/QH2301B\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/","url":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png","contentUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png","width":40,"height":67,"caption":"Gnome Ledge"},"image":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/averageone.com\/","https:\/\/www.linkedin.com\/in\/howeijing-wr\/"]},{"@type":"Person","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5","name":"Wei Jing HO","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g","caption":"Wei Jing HO"},"sameAs":["https:\/\/averageone.com\/"],"url":"https:\/\/gnomeledge.com\/QH2301B\/author\/mr-ho\/"}]}},"_links":{"self":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts\/3291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/comments?post=3291"}],"version-history":[{"count":1,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts\/3291\/revisions"}],"predecessor-version":[{"id":3300,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts\/3291\/revisions\/3300"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/media\/3292"}],"wp:attachment":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/media?parent=3291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/categories?post=3291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/tags?post=3291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}