{"id":3514,"date":"2019-03-01T00:01:23","date_gmt":"2019-03-01T08:01:23","guid":{"rendered":"https:\/\/c-for-dummies.com\/blog\/?p=3514"},"modified":"2019-03-08T16:57:14","modified_gmt":"2019-03-09T00:57:14","slug":"find-the-duplicates","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=3514","title":{"rendered":"Find the Duplicates"},"content":{"rendered":"<p>You&#8217;ll find multiple reasons to remove duplicates from a series of random numbers. The main reason is that the process or generating random numbers is capable of yielding duplicate values. But more importantly, if your list represents discrete items in the real world, such as playing cards, you can&#8217;t really have a duplicate value pop up.<br \/>\n<!--more--><br \/>\nThe task for this month&#8217;s Exercise is to generate a list of 15 random values in the range of 10 to 50. Display each value. Then cull through the list to display any duplicates.<\/p>\n<p>Here&#8217;s sample output from my solution:<\/p>\n<p><code>Array:<br \/>\n&nbsp;13 29 45 30 55 57 18 33 24 26 18 29 54 55 19<br \/>\nDuplicates:<br \/>\n29<br \/>\n55<br \/>\n18<\/code><\/p>\n<p>You don&#8217;t need to purge the duplicates from the array, nor do you need to count how many times a value is repeated. Just display the duplicate values.<\/p>\n<p>Please try this Exercise on your own before looking at <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=3529\">my solution<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Given an array of random values, report which numbers are repeated. <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=3514\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-3514","post","type-post","status-publish","format-standard","hentry","category-exercise"],"_links":{"self":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3514"}],"version-history":[{"count":4,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3514\/revisions"}],"predecessor-version":[{"id":3538,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3514\/revisions\/3538"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}