{"id":232684,"date":"2023-01-27T12:40:00","date_gmt":"2023-01-27T09:40:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=232684"},"modified":"2023-01-29T11:56:32","modified_gmt":"2023-01-29T08:56:32","slug":"hur-loeser-man-math-puzzle-med-powershell-skript-med-bruteforce-algorithm","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/sv\/hur-loeser-man-math-puzzle-med-powershell-skript-med-bruteforce-algorithm\/","title":{"rendered":"Hur l\u00f6ser man Math Puzzle med PowerShell-skript med Bruteforce Algorithm?"},"content":{"rendered":"<p>Detta \u00e4r ett intressant mattepussel:<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155967-61e571f21a75e.png\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155967-61e571f21a75e.png\" alt=\"Hur l\u00f6ser man Math Puzzle med PowerShell-skript med Bruteforce Algorithm?\"><\/a><\/p>\n<p>X, Y och Z \u00e4r ett heltal mellan 0 och 9. s\u00e5 vad \u00e4r de? Vi kan skriva ett <a href=\"https:\/\/helloacm.com\/learning-powershell-recursive-fibonacci-computation\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">PowerShell-<\/a> skript f\u00f6r att s\u00f6ka efter alla m\u00f6jliga v\u00e4rden fr\u00e5n 1 till 9, f\u00f6r X, Y respektive Z.<\/p>\n<pre><code>for ($X = 1; $X -le 9; $X += 1) {\/\/ X can't be zero\n    for ($Y = 1; $Y -le 9; $Y += 1) { \/\/ Y can't be zero either.\n        for ($Z = 0; $Z -le 9; $Z += 1) {\n            $XY = $X * 10 + $Y;\n            $YZZ = $Y * 100 + $Z * 10 + $Z\n            if ($XY + $XY -eq $YZZ) { \/\/ XY + XY = YZZ\n                Write-Host $XY + $XY = $YZZ\n            }\n        }\n    }\n}<\/code><\/pre>\n<p>Detta ger ut: X = 6, Y = 1 och Z = 2. Du beh\u00f6ver inte skriva <a href=\"https:\/\/wordpress.mediadoma.com\/sv\/hur-skyddar-du-din-wordpress-inloggning-fraan-brute-force-attacker-enkelt-tillvaegagaangssaett\/\" title=\"en bruteforce\">en bruteforce<\/a> -algoritm f\u00f6r att s\u00f6ka efter dessa 3 v\u00e4rden p\u00e5 grund av en enkel logik:<\/p>\n<ul>\n<li>X ska vara st\u00f6rre eller lika med 5, annars blir summan inte tresiffrig.<\/li>\n<li>Y kan bara vara 1 dvs de maximala tv\u00e5 siffrorna 99 + 99 = 198.<\/li>\n<li>Y = 1 s\u00e5 Z = 2<\/li>\n<li>och X = 6<\/li>\n<\/ul>\n<p>Du kanske ocks\u00e5 gillar:<a href=\"https:\/\/justyy.com\/archives\/2047\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u5927\u767d+ \u5927\u767d= vit och fet<\/a><\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155967-61e571f314655.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155967-61e571f314655.jpg\" alt=\"Hur l\u00f6ser man Math Puzzle med PowerShell-skript med Bruteforce Algorithm?\"><\/a><\/p>\n<p>powershell-skript<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">Inspelningsk\u00e4lla:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/helloacm.com\" class=\"external external_icon\">helloacm.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hur l\u00f6ser man Math Puzzle med PowerShell-skript med Bruteforce Algorithm?<\/p>\n","protected":false},"author":1,"featured_media":224625,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[1070,848,901,922,724],"tags":[1173],"class_list":["post-232684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-en-dator","category-handledningar","category-koda","category-oevrig","category-utvecklaren","tag-affiai-sv"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/posts\/232684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/comments?post=232684"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/posts\/232684\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/media\/224625"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/media?parent=232684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/categories?post=232684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/sv\/wp-json\/wp\/v2\/tags?post=232684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}