{"id":719,"date":"2023-03-15T21:55:00","date_gmt":"2023-03-15T20:55:00","guid":{"rendered":"https:\/\/blog.adameczek.pl\/?p=719"},"modified":"2024-05-11T17:50:37","modified_gmt":"2024-05-11T15:50:37","slug":"znajdz-dzialania-czesc-i","status":"publish","type":"post","link":"https:\/\/blog.adameczek.pl\/index.php\/2023\/03\/15\/znajdz-dzialania-czesc-i\/","title":{"rendered":"Znajd\u017a dzia\u0142ania &#8211; cz\u0119\u015b\u0107 I"},"content":{"rendered":"\n<p>Zainspirowany pewn\u0105 zagadk\u0105, kt\u00f3r\u0105 otrzyma\u0142em na interview napisa\u0142em aplikacj\u0119, kt\u00f3ra pozwoli obni\u017cy\u0107 poziom stresu przynajmniej do momentu, a\u017c rekturerzy znajd\u0105 ten wpis i wymy\u015bl\u0105 inne zagadki \ud83d\ude42 Zreszt\u0105 spotka\u0142em si\u0119 w takim zadankiem ju\u017c wcze\u015bniej, wi\u0119c tym bardziej zachcia\u0142em spraw\u0119 ogarn\u0105\u0107. Ot\u00f3\u017c jest pewna kategoria zabaw matematycznych, kt\u00f3ra polega na tym, \u017ce z kilku cyfr zestawia si\u0119 r\u00f3wnanie, kt\u00f3re jest \u201eniedoko\u0144czone\u201d. Nale\u017cy pogrupowa\u0107 cyfry i powstawia\u0107 mi\u0119dzy nie operatory +, -, *, \/ aby r\u00f3wnanie by\u0142o prawdziwe. Przyk\u0142ad:<\/p>\n\n\n\n<p class=\"has-text-align-center\"><code>4 4 4 4 4 = 5 5<\/code><\/p>\n\n\n\n<p>Rozwi\u0105zania:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>44 \/ 4 - 4 \/ 4\u00a0=\u00a05 + 5<\/code><\/li>\n\n\n\n<li><code>44 + 44 \/ 4\u00a0=\u00a055<\/code><\/li>\n\n\n\n<li><code>44 \/ 4 + 44\u00a0=\u00a055<\/code><\/li>\n<\/ul>\n\n\n\n<p>Albo takie cyferki:<\/p>\n\n\n\n<p class=\"has-text-align-center\"><code>1 2 3 4 = 5 6<\/code><\/p>\n\n\n\n<p>Mo\u017cna powi\u0105za\u0107 nast\u0119puj\u0105co:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>1 - 2 * 3 + 4\u00a0=\u00a05 - 6<\/code><\/li>\n\n\n\n<li><code>1 + 2 * 3 + 4\u00a0=\u00a05 + 6<\/code><\/li>\n\n\n\n<li><code>1 - 2 + 3 * 4\u00a0=\u00a05 + 6<\/code><\/li>\n\n\n\n<li><code>12 + 3 - 4\u00a0=\u00a05 + 6<\/code><\/li>\n<\/ul>\n\n\n\n<p>Nie umniejszaj\u0105c zaletom \u0142amania g\u0142owy przy wynajdowaniu rozwi\u0105za\u0144, ja postanowi\u0142em do sprawy podej\u015b\u0107 programistycznie. Powsta\u0142a aplikacja, kt\u00f3ra znajduje wszystkie mo\u017cliwe rozwi\u0105zania dla danych zestaw\u00f3w liczb. Mo\u017cna si\u0119 ni\u0105 pos\u0142u\u017cy\u0107 przy rozstrzyganiu zak\u0142ad\u00f3w o to, ile jest mo\u017cliwych rozwi\u0105za\u0144, tworzeniu zagadek (to dla rekruter\u00f3w), albo ich rozwi\u0105zywaniu (aplikanci). Programik jest dost\u0119pny tu <a rel=\"noreferrer noopener\" href=\"https:\/\/playwithnumbers.azurewebsites.net\/\" target=\"_blank\">Play With Numbers<\/a> (uwaga: Azure Apps w bezp\u0142atnej wersji potrafi\u0105 'zamrozi\u0107\u2019 aplikacj\u0119, a jest przywracanie trwa nawet 3-4 minuty). W kolejnych wpisach blogu poznany algorytm, kt\u00f3ry program nap\u0119dza.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zainspirowany pewn\u0105 zagadk\u0105, kt\u00f3r\u0105 otrzyma\u0142em na interview napisa\u0142em aplikacj\u0119, kt\u00f3ra pozwoli obni\u017cy\u0107 poziom stresu przynajmniej do momentu, a\u017c rekturerzy znajd\u0105 ten wpis i wymy\u015bl\u0105 inne zagadki \ud83d\ude42 Zreszt\u0105 spotka\u0142em si\u0119 w takim zadankiem ju\u017c wcze\u015bniej, wi\u0119c tym bardziej zachcia\u0142em spraw\u0119 ogarn\u0105\u0107. Ot\u00f3\u017c jest pewna kategoria zabaw matematycznych, kt\u00f3ra polega na tym, \u017ce z kilku cyfr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":822,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","_jetpack_memberships_contains_paid_content":false,"ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[10],"tags":[15],"class_list":["post-719","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","tag-csharp","entry","has-media"],"jetpack_featured_media_url":"https:\/\/blog.adameczek.pl\/wp-content\/uploads\/2024\/05\/Csharp_logo.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/posts\/719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/comments?post=719"}],"version-history":[{"count":7,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/posts\/719\/revisions"}],"predecessor-version":[{"id":731,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/posts\/719\/revisions\/731"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/media\/822"}],"wp:attachment":[{"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/media?parent=719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/categories?post=719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.adameczek.pl\/index.php\/wp-json\/wp\/v2\/tags?post=719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}