{"id":16244,"date":"2023-02-13T22:42:18","date_gmt":"2023-02-13T17:12:18","guid":{"rendered":"https:\/\/www.interviewbit.com\/blog\/?post_type=web-story&#038;p=16244"},"modified":"2023-02-13T22:42:19","modified_gmt":"2023-02-13T17:12:19","slug":"how-to-find-subarray-with-given-sum","status":"publish","type":"web-story","link":"https:\/\/www.interviewbit.com\/blog\/web-stories\/how-to-find-subarray-with-given-sum\/","title":{"rendered":"How to Find Subarray with Given Sum?"},"content":{"rendered":"<p><html amp=\"\" lang=\"en\"><head><meta charSet=\"utf-8\"\/><meta name=\"viewport\" content=\"width=device-width,minimum-scale=1,initial-scale=1\"\/><script async=\"\" src=\"https:\/\/cdn.ampproject.org\/v0.js\"><\/script><script async=\"\" src=\"https:\/\/cdn.ampproject.org\/v0\/amp-story-1.0.js\" custom-element=\"amp-story\"><\/script><link href=\"https:\/\/fonts.googleapis.com\/css2?display=swap&amp;family=Roboto%3Awght%40400%3B700&amp;family=Darker+Grotesque%3Awght%40400%3B700&amp;family=Merriweather%3Awght%40700&amp;family=Poppins%3Awght%40700\" rel=\"stylesheet\"\/><link href=\"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2048&amp;h=1536&amp;fit=max\" rel=\"preload\" as=\"image\"\/>\n<style amp-boilerplate=\"\">body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}<\/style>\n<p><noscript><\/p>\n<style amp-boilerplate=\"\">body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}<\/style>\n<p><\/noscript><\/p>\n<style amp-custom=\"\">\n              h1, h2, h3 { font-weight: normal; }<\/p>\n<p>              amp-story-page {\n                background-color: #131516;\n              }<\/p>\n<p>              amp-story-grid-layer {\n                overflow: visible;\n              }<\/p>\n<p>              @media (max-aspect-ratio: 9 \/ 16)  {\n                @media (min-aspect-ratio: 320 \/ 678) {\n                  amp-story-grid-layer.grid-layer {\n                    margin-top: calc((100% \/ 0.5625 - 100% \/ 0.6666666666666666) \/ 2);\n                  }\n                }\n              }<\/p>\n<p>              @media not all and (min-resolution:.001dpcm) {\n                @media {\n                  p.text-wrapper > span {\n                    font-size: calc(100% - 0.5px);\n                  }\n                }\n              }<\/p>\n<p>              .page-fullbleed-area,\n              .page-background-overlay-area {\n                position: absolute;\n                overflow: hidden;\n                width: 100%;\n                left: 0;\n                height: calc(1.1851851851851851 * 100%);\n                top: calc((1 - 1.1851851851851851) * 100% \/ 2);\n              }<\/p>\n<p>              .element-overlay-area {\n                position: absolute;\n                width: 100%;\n                height: 100%;\n                top: 0;\n                left: 0;\n              }<\/p>\n<p>              .page-safe-area {\n                overflow: visible;\n                position: absolute;\n                top: 0;\n                bottom: 0;\n                left: 0;\n                right: 0;\n                width: 100%;\n                height: calc(0.84375 * 100%);\n                margin: auto 0;\n              }<\/p>\n<p>              .mask {\n                position: absolute;\n                overflow: hidden;\n              }<\/p>\n<p>              .fill {\n                position: absolute;\n                top: 0;\n                left: 0;\n                right: 0;\n                bottom: 0;\n                margin: 0;\n              }<\/p>\n<p>              @media (prefers-reduced-motion: no-preference) {\n                .animation-wrapper {\n                  opacity: var(--initial-opacity);\n                  transform: var(--initial-transform);\n                }\n              }<\/p>\n<p>              amp-story-grid-layer.align-bottom {\n                align-content: end;\n                padding: 0;\n              }<\/p>\n<p>              .captions-area {\n                padding: 0 32px 0;\n              }<\/p>\n<p>              amp-story-captions {\n                margin-bottom: 16px;\n                text-align: center;\n              }<\/p>\n<p>              amp-story-captions span {\n                display: inline-block;\n                margin: 0;\n                padding: 6px 12px;\n                vertical-align: middle;\n                border-radius: 15px;\n                background: rgba(11, 11, 11, 0.6);\n                color: rgba(255, 255, 255, 1);\n                font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;;\n                font-size: calc(4 * var(--story-page-vw));\n                line-height: 1.4;\n                word-break: break-word;\n                word-wrap: break-word;\n                overflow-wrap: break-word;\n              }\n              <\/style>\n<p><meta name=\"web-stories-replace-head-start\"\/><title>How to Find Subarray with Given Sum?<\/title><link rel=\"canonical\" href=\"https:\/\/www.interviewbit.com\/blog\/?post_type=web-story&amp;p=16244\"\/><meta name=\"web-stories-replace-head-end\"\/><\/head><body><amp-story standalone=\"\" publisher=\"InterviewBit\" publisher-logo-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/cropped-tumblr-logo.png\" title=\"How to Find Subarray with Given Sum?\" poster-portrait-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2023\/02\/cropped-week-3-feb-13th-subarray-with-given-sum.png\"><amp-story-page id=\"d1e9a7c2-404d-415a-a2eb-eea40554940b\" auto-advance-after=\"7s\"><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#0c2640\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-8713361c-f03a-487f-9a51-a0f98b9ddadb\">\n<div style=\"position:absolute;width:237.03704%;height:100%;left:-68.51852%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2048&amp;h=1536&amp;fit=max\" alt=\"geometric shape digital wallpaper\" srcSet=\"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2048&amp;h=1536&amp;fit=max 2048w,https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1638&amp;h=1229&amp;fit=max 1638w,https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1228&amp;h=921&amp;fit=max 1228w,https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=819&amp;h=614&amp;fit=max 819w,https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=409&amp;h=307&amp;fit=max 409w,https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=255&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 107vh, 238vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-image:linear-gradient(0.5turn, rgba(0,0,0,0) 40%, rgba(0,0,0,0.5) 100%)\"><\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-image:linear-gradient(0.5turn, rgba(0,0,0,0) 40%, rgba(0,0,0,0.5) 100%)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-96332792-fe49-4105-a90e-4f4a9d61ad55\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:5.33981%;top:54.36893%;width:76.69903%;height:25.56634%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.6329113924050633% 0.6329113924050633% 0.6329113924050633% 0.6329113924050633% \/ 1.2658227848101267% 1.2658227848101267% 1.2658227848101267% 1.2658227848101267%\" id=\"el-95a17566-0eff-4d0a-a9a1-c1eab9f25976\">\n<h1 id=\"how-to-find-subarray-with-given-sum\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.3597705696202531% 0;font-family:&quot;Roboto&quot;,sans-serif;font-size:0.809061em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #fff\">How to Find Subarray with Given Sum?<\/span><\/span><\/h1>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:5.58252%;top:81.06796%;width:91.26214%;height:5.66343%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5319148936170213% 0.5319148936170213% 0.5319148936170213% 0.5319148936170213% \/ 5.714285714285714% 5.714285714285714% 5.714285714285714% 5.714285714285714%\" id=\"el-cd5e9604-8a06-49c9-ac81-19784a284f87\">\n<h2 id=\"a-quick-guide\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:-0.11220079787234044% 0;font-family:&quot;Roboto&quot;,sans-serif;font-size:0.485437em;line-height:1.2;text-align:left;padding:0;color:#000000\"><span><span style=\"color: #347eff\">A Quick Guide<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:3.8835%;top:90.7767%;width:36.16505%;height:14.23948%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-1635eb8e-c97a-4bdf-98ea-5a430567b7fd\">\n<div style=\"position:absolute;width:100%;height:127.98857%;left:0%;top:-13.99429%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAi\/arrow.gif\" alt=\"Arrow Sticker\" srcSet=\"https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAi\/arrow.gif 127w,https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAk\/arrow.gif 90w\" sizes=\"(min-width: 1024px) 16vh, 36vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><\/amp-story-page><amp-story-page id=\"ae40903e-5d0a-4461-bb14-d9db3bfd6b21\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-0e873165-e3fc-46e8-8b19-ca7168ccaa34\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-31b812dc-7c4b-4961-8b6b-071237e826c8\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-077d633d-f54e-4039-947b-f263f971c861 [data-leaf-element=\\\"true\\\"]\",\"keyframes\":{\"transform\":[\"translate(0%, 0%) scale(1.5)\",\"translate(0%, 0%) scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#262626\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div id=\"anim-077d633d-f54e-4039-947b-f263f971c861\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-76638dd5-e923-4c37-8934-99f03447a159\">\n<div style=\"position:absolute;width:266.31253%;height:100%;left:-83.15627%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max\" alt=\"woman in black shirt using laptop computer\" srcSet=\"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max 6016w,https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4812&amp;h=3212&amp;fit=max 4812w,https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3609&amp;h=2409&amp;fit=max 3609w,https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2406&amp;h=1606&amp;fit=max 2406w,https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1203&amp;h=803&amp;fit=max 1203w,https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=227&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 120vh, 267vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-a3bb84b5-e208-4e2a-936f-5611c92d7d16\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:6.79612%;top:34.46602%;width:86.40777%;height:40.61489%;opacity:1\">\n<div id=\"anim-0e873165-e3fc-46e8-8b19-ca7168ccaa34\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-31b812dc-7c4b-4961-8b6b-071237e826c8\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5617977528089888% 0.5617977528089888% 0.5617977528089888% 0.5617977528089888% \/ 0.796812749003984% 0.796812749003984% 0.796812749003984% 0.796812749003984%\" id=\"el-01463911-9ace-441d-a6f8-4307552a5552\">\n<h2 id=\"are-you-searching-for-a-method-to-find-a-subarray-that-adds-up-to-a-specific-sum-look-no-further-lets-explore-different-methods-to-find-subarrays-with-a-given-sum\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.5% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"color: #fff\">Are you searching for a method to find a subarray that adds up to a specific sum? Look no further! &nbsp;&nbsp;<\/span><\/p>\n<p><span style=\"color: #347eff\">Let\u2019s explore different methods to find subarrays with a given sum.<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/Josephus-Problem.png\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"89c46d12-909f-4a7b-b582-777f409a4ac2\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-34b2fbd6-3ae6-4ba4-b512-7e39f27e9036 [data-leaf-element=\\\"true\\\"]\",\"keyframes\":{\"transform\":[\"translate(0%, 0%) scale(1.5)\",\"translate(0%, 0%) scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-4d6db40a-e595-4b5a-9ee0-ad0449333812\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-170aa82d-0c1f-44c8-9dff-58d8638fd949\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-f5924d1e-b742-4b0a-bec0-954fd428a025\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-a2af5277-acfd-4632-a35f-976f365a298b\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#f3f3f3\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div id=\"anim-34b2fbd6-3ae6-4ba4-b512-7e39f27e9036\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-76638dd5-e923-4c37-8934-99f03447a159\">\n<div style=\"position:absolute;width:266.31253%;height:100%;left:-83.15627%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max\" alt=\"photography of three women sits beside table inside room during daytime\" srcSet=\"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max 6016w,https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4812&amp;h=3212&amp;fit=max 4812w,https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3609&amp;h=2409&amp;fit=max 3609w,https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2406&amp;h=1606&amp;fit=max 2406w,https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1203&amp;h=803&amp;fit=max 1203w,https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=227&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 120vh, 267vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-90701d05-70b8-48ba-9066-72199e99b3ce\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.28155%;top:35.11327%;width:85.43689%;height:30.74434%;opacity:1\">\n<div id=\"anim-4d6db40a-e595-4b5a-9ee0-ad0449333812\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-170aa82d-0c1f-44c8-9dff-58d8638fd949\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5681818181818182% 0.5681818181818182% 0.5681818181818182% 0.5681818181818182% \/ 1.0526315789473684% 1.0526315789473684% 1.0526315789473684% 1.0526315789473684%\" id=\"el-beb9cd08-b670-4372-bebb-c5ab5af8e430\">\n<h2 id=\"given-an-array-of-integers-the-goal-is-to-locate-a-non-empty-subarray-that-adds-up-to-the-specified-sum-sound-complicated\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.5170454545454544% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"color: #fff\">Given an array of integers, the goal is to locate a non-empty subarray that adds up to the specified sum.&nbsp;<\/span><\/p>\n<p><span style=\"color: #347eff\">Sound complicated?&nbsp;<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:0;top:4.69256%;width:99.51456%;height:11.65049%;opacity:1\">\n<div id=\"anim-f5924d1e-b742-4b0a-bec0-954fd428a025\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-a2af5277-acfd-4632-a35f-976f365a298b\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.4878048780487805% 0.4878048780487805% 0.4878048780487805% 0.4878048780487805% \/ 2.7777777777777777% 2.7777777777777777% 2.7777777777777777% 2.7777777777777777%;background-clip:content-box;background-color:#052258\" id=\"el-474ddcc5-f7c3-4dc9-a20c-3f6b657b137f\">\n<h1 id=\"problem-statement\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:2.613658536585366% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.760518em;line-height:0.9;text-align:center;padding:0.975609756097561% 1.951219512195122%;color:#000000\"><span><span style=\"font-weight: 700; color: #3372e0\">Problem Statement<\/span><\/span><\/h1>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"de3e1538-90d1-44c3-9dc1-e9eb15aea441\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-f209e526-63dc-4ad7-803f-8dade928b52f\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-a2f8c6c8-cd77-4a98-9532-fb9c2c0a7e10\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-a1b54f34-e173-404c-bbd0-2b81c705ab18 [data-leaf-element=\\\"true\\\"]\",\"keyframes\":{\"transform\":[\"translate(0%, 0%) scale(1.5)\",\"translate(0%, 0%) scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#d9d9d9\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div id=\"anim-a1b54f34-e173-404c-bbd0-2b81c705ab18\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-76638dd5-e923-4c37-8934-99f03447a159\">\n<div style=\"position:absolute;width:266.31253%;height:100%;left:-83.15627%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max\" alt=\"photography of people inside room during daytime\" srcSet=\"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max 6016w,https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4812&amp;h=3212&amp;fit=max 4812w,https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3609&amp;h=2409&amp;fit=max 3609w,https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2406&amp;h=1606&amp;fit=max 2406w,https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1203&amp;h=803&amp;fit=max 1203w,https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=227&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 120vh, 267vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-ca607fc3-47ce-46f2-be0f-336346011aab\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.52427%;top:24.11003%;width:84.46602%;height:55.17799%;opacity:1\">\n<div id=\"anim-f209e526-63dc-4ad7-803f-8dade928b52f\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-a2f8c6c8-cd77-4a98-9532-fb9c2c0a7e10\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5747126436781609% 0.5747126436781609% 0.5747126436781609% 0.5747126436781609% \/ 0.5865102639296188% 0.5865102639296188% 0.5865102639296188% 0.5865102639296188%\" id=\"el-91e1f96d-98c1-4640-bbd8-2ceb2f611100\">\n<h2 id=\"example-input-11-9-8-7-13-5-17-sum-25-output-yes-explanation-the-subarray-7-13-5-adds-up-to-25\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.5344827586206895% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #347eff\">Example- &nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 700; color: #fff\">Input:<\/span><span style=\"color: #fff\"> [11, 9, 8, 7, 13, 5, 17]&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 700; color: #fff\">Sum: <\/span><span style=\"color: #fff\">25 &nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 700; color: #fff\">Output: <\/span><span style=\"color: #fff\">YES&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 700; color: #fff\">Explanation: <\/span><span style=\"color: #fff\">The subarray [7, 13, 5] adds up to 25.&nbsp;<\/span><\/p>\n<p><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"9e5d6a53-c17c-415a-b590-e6df6d6fd3f4\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-87186248-6afa-4af7-a630-7a8ec9c83124 [data-leaf-element=\\\"true\\\"]\",\"keyframes\":{\"transform\":[\"translate(0%, 0%) scale(1.5)\",\"translate(0%, 0%) scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-2091cba8-6964-43ba-98f9-78a47bee1e26\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-ce30cb53-f441-45b6-aeaa-e8be08bbb892\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-cea435e3-316c-4570-9cf9-887bde4a5224\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-b60dc9f0-a630-449a-9adc-83a69e80257f\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#f3a673\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div id=\"anim-87186248-6afa-4af7-a630-7a8ec9c83124\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-27f2951c-8b6e-4772-8cc9-8a5b431fd5c6\">\n<div style=\"position:absolute;width:266.31253%;height:100%;left:-83.15627%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max\" alt=\"people sitting beside rectangular brown table with laptops\" srcSet=\"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max 6016w,https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4812&amp;h=3212&amp;fit=max 4812w,https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3609&amp;h=2409&amp;fit=max 3609w,https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2406&amp;h=1606&amp;fit=max 2406w,https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1203&amp;h=803&amp;fit=max 1203w,https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=227&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 120vh, 267vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-f24b57dc-e5b9-416a-be22-4a071ebd4794\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:0;top:4.69256%;width:99.51456%;height:18.4466%;opacity:1\">\n<div id=\"anim-2091cba8-6964-43ba-98f9-78a47bee1e26\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-ce30cb53-f441-45b6-aeaa-e8be08bbb892\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.4878048780487805% 0.4878048780487805% 0.4878048780487805% 0.4878048780487805% \/ 1.7543859649122806% 1.7543859649122806% 1.7543859649122806% 1.7543859649122806%;background-clip:content-box;background-color:#052258\" id=\"el-8fb0e3eb-6cd5-42d7-8885-accf73ddaeed\">\n<h1 id=\"approach-1-naive-approach\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:2.613658536585366% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.760518em;line-height:0.9;text-align:center;padding:0.975609756097561% 1.951219512195122%;color:#000000\"><span><span style=\"font-weight: 700; color: #3372e0\">Approach 1-&nbsp;<\/span><br \/>\n<span style=\"font-weight: 700; color: #3372e0\">Naive Approach<\/span><\/span><\/h1>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.76699%;top:37.54045%;width:84.46602%;height:21.0356%;opacity:1\">\n<div id=\"anim-cea435e3-316c-4570-9cf9-887bde4a5224\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-b60dc9f0-a630-449a-9adc-83a69e80257f\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5747126436781609% 0.5747126436781609% 0.5747126436781609% 0.5747126436781609% \/ 1.5384615384615385% 1.5384615384615385% 1.5384615384615385% 1.5384615384615385%\" id=\"el-e8aea5b7-d448-4343-8e51-1d97745db66a\">\n<h2 id=\"the-naive-approach-involves-checking-every-single-subarray-for-the-given-sum-are-you-ready-to-see-it-in-action\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.5344827586206895% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"color: #fff\">The naive approach involves checking every single subarray for the given sum. Are you ready to see it in action?<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/Josephus-Problem.png\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"cf434d3e-3132-4b3c-87e0-5ae80860d37a\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-fa0a2111-66f7-438e-a505-13593cc0f748 [data-leaf-element=\\\"true\\\"]\",\"keyframes\":{\"transform\":[\"translate(0%, 0%) scale(1.5)\",\"translate(0%, 0%) scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-043fc9a1-b125-4db0-b029-54dd40b26d9f\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-db3e5859-4293-4efb-a204-3a6ab7f72300\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#262626\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div id=\"anim-fa0a2111-66f7-438e-a505-13593cc0f748\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-4bea2dab-2033-49a6-a9a8-b6dc345abb9c\">\n<div style=\"position:absolute;width:266.31253%;height:100%;left:-83.15627%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max\" alt=\"three women sitting beside wooden table\" srcSet=\"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=6016&amp;h=4016&amp;fit=max 6016w,https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4812&amp;h=3212&amp;fit=max 4812w,https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3609&amp;h=2409&amp;fit=max 3609w,https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2406&amp;h=1606&amp;fit=max 2406w,https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1203&amp;h=803&amp;fit=max 1203w,https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=227&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 120vh, 267vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-2ad5ac42-0aab-4934-a886-dd828e311d1a\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.28155%;top:34.46602%;width:85.43689%;height:21.0356%;opacity:1\">\n<div id=\"anim-043fc9a1-b125-4db0-b029-54dd40b26d9f\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-db3e5859-4293-4efb-a204-3a6ab7f72300\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5681818181818182% 0.5681818181818182% 0.5681818181818182% 0.5681818181818182% \/ 1.5384615384615385% 1.5384615384615385% 1.5384615384615385% 1.5384615384615385%\" id=\"el-10752c12-70a7-4a16-8ef9-0e5287245dc9\">\n<h2 id=\"time-complexity-on2-where-n-is-the-size-of-the-array-space-complexity-o1\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.5170454545454544% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #347eff\">Time complexity: <\/span><span style=\"color: #fff\">O(N^2), where N is the size of the array.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 700; color: #347eff\">Space complexity: <\/span><span style=\"color: #fff\">O(1)<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"015ce16c-01eb-4503-a5fd-c69fd2ace5d2\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-41828564-2035-4226-b485-a8d4f41285c0\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-5592058d-8abc-4ad3-80a3-65c25c494bbb\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-2d333dbf-1737-44c3-9d96-ed89524782e0 [data-leaf-element=\\\"true\\\"]\",\"keyframes\":{\"transform\":[\"translate(0%, 0%) scale(1.5)\",\"translate(0%, 0%) scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-d6846689-7dab-4bba-af38-ab32fbc4b8e4\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-d9fe7a7c-e317-41e4-a986-7dcdd58fd326\",\"keyframes\":{\"transform\":[\"scale(0.3333333333333333)\",\"scale(1)\"]},\"delay\":0,\"duration\":2000,\"easing\":\"cubic-bezier(.3,0,.55,1)\",\"fill\":\"forwards\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#a6c0c0\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div id=\"anim-2d333dbf-1737-44c3-9d96-ed89524782e0\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-07cb1230-628a-4b45-910c-b13bf7f662ea\">\n<div style=\"position:absolute;width:133.38261%;height:100%;left:-16.6913%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2707&amp;h=3608&amp;fit=max\" alt=\"man in blue hoodie looking at macbook\" srcSet=\"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2707&amp;h=3608&amp;fit=max 2707w,https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2165&amp;h=2886&amp;fit=max 2165w,https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1624&amp;h=2165&amp;fit=max 1624w,https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1082&amp;h=1442&amp;fit=max 1082w,https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=541&amp;h=721&amp;fit=max 541w,https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=453&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 60vh, 134vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-ddd85b20-5151-46db-b5aa-6c37b1273284\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.28155%;top:36.40777%;width:85.43689%;height:45.46926%;opacity:1\">\n<div id=\"anim-41828564-2035-4226-b485-a8d4f41285c0\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-5592058d-8abc-4ad3-80a3-65c25c494bbb\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5681818181818182% 0.5681818181818182% 0.5681818181818182% 0.5681818181818182% \/ 0.7117437722419928% 0.7117437722419928% 0.7117437722419928% 0.7117437722419928%\" id=\"el-5a80f896-83ce-48d0-b555-413c716f09c1\">\n<h2 id=\"speed-up-your-search-for-the-perfect-subarray-with-this-approach-it-involves-taking-an-empty-window-and-adjusting-it-until-the-given-constraint-is-satisfied-ready-to-see-how-it-works-check-o\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.5170454545454544% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"color: #fff\">Speed up your search for the perfect subarray with this approach. It involves taking an empty window and adjusting it until the given constraint is satisfied. &nbsp;<\/span><\/p>\n<p><span style=\"color: #347eff\">Ready to see how it works? Check out the algorithm!<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:0;top:4.69256%;width:99.51456%;height:18.4466%;opacity:1\">\n<div id=\"anim-d6846689-7dab-4bba-af38-ab32fbc4b8e4\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-d9fe7a7c-e317-41e4-a986-7dcdd58fd326\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:scale(0.3333333333333333)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.4878048780487805% 0.4878048780487805% 0.4878048780487805% 0.4878048780487805% \/ 1.7543859649122806% 1.7543859649122806% 1.7543859649122806% 1.7543859649122806%;background-clip:content-box;background-color:#052258\" id=\"el-f7104d53-7c22-4289-abb4-0c197e2adb73\">\n<h1 id=\"approach-2-sliding-window\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:2.613658536585366% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.760518em;line-height:0.9;text-align:center;padding:0.975609756097561% 1.951219512195122%;color:#000000\"><span><span style=\"font-weight: 700; color: #3372e0\">Approach 2-&nbsp;<\/span><br \/>\n<span style=\"font-weight: 700; color: #3372e0\">Sliding window<\/span><\/span><\/h1>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/Josephus-Problem.png\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"936b559d-4dc0-423a-9d89-b4d4ba99b081\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-9fc462a8-703f-4024-9a27-b94f76fac234\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":600,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-056ba4dc-cc6b-4095-95b1-ee3f1d6a79f8\",\"keyframes\":{\"transform\":[\"translate3d(-105.86593%, 0px, 0)\",\"translate3d(0px, 0px, 0)\"]},\"delay\":0,\"duration\":600,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-f334c298-659e-4274-a03b-5a15bb6669a2\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":600,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-c2290685-2307-4132-adef-99928c682c8f\",\"keyframes\":{\"transform\":[\"translate3d(0px, -260.77716%, 0)\",\"translate3d(0px, 0px, 0)\"]},\"delay\":0,\"duration\":600,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#0c2626\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-07cb1230-628a-4b45-910c-b13bf7f662ea\">\n<div style=\"position:absolute;width:267.16887%;height:100%;left:-83.58443%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4256&amp;h=2832&amp;fit=max\" alt=\"photo of outer space\" srcSet=\"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4256&amp;h=2832&amp;fit=max 4256w,https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3404&amp;h=2265&amp;fit=max 3404w,https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2553&amp;h=1699&amp;fit=max 2553w,https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1702&amp;h=1133&amp;fit=max 1702w,https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=851&amp;h=566&amp;fit=max 851w,https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=226&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 121vh, 268vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.4)\"><\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.4)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-380e77ec-becc-4e13-b03c-a3c1bed377c3\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:5.09709%;top:67.96117%;width:86.8932%;height:11.48867%;opacity:1\">\n<div id=\"anim-9fc462a8-703f-4024-9a27-b94f76fac234\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-056ba4dc-cc6b-4095-95b1-ee3f1d6a79f8\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:translate3d(-105.86593%, 0px, 0)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5586592178770949% 0.5586592178770949% 0.5586592178770949% 0.5586592178770949% \/ 2.8169014084507045% 2.8169014084507045% 2.8169014084507045% 2.8169014084507045%\" id=\"el-faf98ac9-3bde-42ce-ba57-b4ed553c9aaf\">\n<h2 id=\"click-on-the-link-below-to-start-your-journey\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.4916201117318435% 0;font-family:&quot;Darker Grotesque&quot;,sans-serif;font-size:0.485437em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #347eff\">Click on the link below to start your journey.<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:5.09709%;top:38.34951%;width:72.81553%;height:29.61165%;opacity:1\">\n<div id=\"anim-f334c298-659e-4274-a03b-5a15bb6669a2\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-c2290685-2307-4132-adef-99928c682c8f\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:translate3d(0px, -260.77716%, 0)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.6666666666666667% 0.6666666666666667% 0.6666666666666667% 0.6666666666666667% \/ 1.092896174863388% 1.092896174863388% 1.092896174863388% 1.092896174863388%\" id=\"el-6bcfeeb7-4083-4a82-a8c2-5231fcf41193\">\n<h2 id=\"are-you-ready-to-level-up-your-coding-skills\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.8418333333333325% 0;font-family:&quot;Merriweather&quot;,serif;font-size:0.695793em;line-height:1;text-align:left;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #fff\">Are you ready to level up your coding skills?<\/span><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\" cta-image=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg\"><a href=\"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=how-to-find-subarray-with-given-sum\" rel=\"\">Click here<\/a><\/amp-story-page-outlink><\/amp-story-page><amp-story-page id=\"736f464b-c940-47d7-a25d-3cfd57bdec11\" auto-advance-after=\"7s\"><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-7fe7cef5-f27a-46cc-b605-9573d38a9d5f\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":1000,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-a42ccde9-0efb-4a03-a02e-792c53172940\",\"keyframes\":{\"transform\":[\"translate3d(0px, -211.49618%, 0)\",\"translate3d(0px, 0px, 0)\"]},\"delay\":0,\"duration\":1000,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-3167db06-fdbb-4dcc-a33d-5b60ce968d28\",\"keyframes\":{\"opacity\":[0,1]},\"delay\":0,\"duration\":600,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-animation layout=\"nodisplay\" trigger=\"visibility\"><script type=\"application\/json\">[{\"selector\":\"#anim-085ec2f3-fb56-49bf-b5b1-8ccd824c75ac\",\"keyframes\":{\"transform\":[\"translate3d(0px, -621.00265%, 0)\",\"translate3d(0px, 0px, 0)\"]},\"delay\":0,\"duration\":600,\"easing\":\"cubic-bezier(0.2, 0.6, 0.0, 1)\",\"fill\":\"both\"}]<\/script><\/amp-story-animation><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\" style=\"background-color:#0c2626\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-9.25926%;width:100%;height:118.51852%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-5e0b0d71-adf4-40a7-b66a-df56c38694fc\">\n<div style=\"position:absolute;width:118.51852%;height:100%;left:-9.25926%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4000&amp;h=6000&amp;fit=max\" alt=\"man using laptop\" srcSet=\"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=4000&amp;h=6000&amp;fit=max 4000w,https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=3200&amp;h=4800&amp;fit=max 3200w,https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=2400&amp;h=3600&amp;fit=max 2400w,https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=1600&amp;h=2400&amp;fit=max 1600w,https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=800&amp;h=1200&amp;fit=max 800w,https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&amp;ixlib=rb-4.0.3&amp;fm=jpg&amp;w=340&amp;h=510&amp;fit=max 340w\" sizes=\"(min-width: 1024px) 53vh, 119vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<div class=\"element-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<div class=\"page-background-overlay-area\" style=\"background-color:rgba(0,0,0,0.5)\"><\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-grid-layer template=\"vertical\" aspect-ratio=\"412:618\" class=\"grid-layer\"><\/p>\n<div class=\"page-fullbleed-area\">\n<div class=\"page-safe-area\">\n<div style=\"position:absolute;pointer-events:none;left:0;top:-6.31068%;width:43.68932%;height:9.70874%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" class=\"mask\" id=\"el-14c4f8e1-e8cb-4904-9519-cbcd2f86b4f3\">\n<div style=\"position:absolute;width:100.28251%;height:100%;left:-0.14125%;top:0%\" data-leaf-element=\"true\"><amp-img layout=\"fill\" src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png\" alt=\"InterviewBit-White-2\" srcSet=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png 2130w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png 2048w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png 1536w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png 1024w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png 768w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png 300w,https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png 150w\" sizes=\"(min-width: 1024px) 20vh, 44vw\" disable-inline-width=\"true\"><\/amp-img><\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.52427%;top:27.18447%;width:88.34951%;height:32.68608%;opacity:1\">\n<div id=\"anim-7fe7cef5-f27a-46cc-b605-9573d38a9d5f\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-a42ccde9-0efb-4a03-a02e-792c53172940\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:translate3d(0px, -211.49618%, 0)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" id=\"el-4a501d26-7978-408e-a405-3aa09dd9488d\">\n<p class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:1.7719780219780208% 0;font-family:&quot;Poppins&quot;,sans-serif;font-size:0.695793em;line-height:1.1;text-align:initial;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #fff\">Step Up Your Game with InterviewBit Web Stories<\/span><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:7.28155%;top:59.87055%;width:82.52427%;height:13.26861%;opacity:1\">\n<div id=\"anim-3167db06-fdbb-4dcc-a33d-5b60ce968d28\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:0;--initial-transform:none\">\n<div id=\"anim-085ec2f3-fb56-49bf-b5b1-8ccd824c75ac\" class=\"animation-wrapper\" style=\"width:100%;height:100%;display:block;position:absolute;top:0;left:0;--initial-opacity:1;--initial-transform:translate3d(0px, -621.00265%, 0)\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0;border-radius:0.5882352941176471% 0.5882352941176471% 0.5882352941176471% 0.5882352941176471% \/ 2.4390243902439024% 2.4390243902439024% 2.4390243902439024% 2.4390243902439024%\" id=\"el-059b3c60-05fd-4f35-a8b6-7e0f46822ae8\">\n<h3 id=\"dont-miss-out-on-the-chance-to-upskill-yourself-with-intervewbits-engaging-web-stories\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:-0.09512867647058793% 0;font-family:&quot;Roboto&quot;,sans-serif;font-size:0.372168em;line-height:1.2;text-align:left;padding:0;color:#000000\"><span><span style=\"color: #fff\">Don&#8217;t miss out on the chance to upskill yourself with IntervewBit&#8217;s engaging web stories.&nbsp;<\/span><\/span><\/h3>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"position:absolute;pointer-events:none;left:4.85437%;top:4.36893%;width:19.66019%;height:45.79288%;opacity:1\">\n<div style=\"pointer-events:initial;width:100%;height:100%;display:block;position:absolute;top:0;left:0;z-index:0\" id=\"el-e0a006e6-161a-41fd-bd99-ad9adeb2d6a5\">\n<h1 id=\"\" class=\"fill text-wrapper\" style=\"white-space:pre-line;overflow-wrap:break-word;word-break:break-word;margin:49.876543209876516% 0;font-family:&quot;Poppins&quot;,sans-serif;font-size:3.268608em;line-height:1;text-align:initial;padding:0;color:#000000\"><span><span style=\"font-weight: 700; color: #fff\">\u201c<\/span><\/span><\/h1>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/amp-story-grid-layer><amp-story-page-outlink layout=\"nodisplay\"><a href=\"https:\/\/www.interviewbit.com\/blog\/web-stories\/?utm_source=Ib&amp;utm_medium=webstories&amp;utm_campaign=unlimited-learning-with-engaging-web-stories\" rel=\"\">SWIPE UP<\/a><\/amp-story-page-outlink><\/amp-story-page><\/amp-story><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"In this web story, we will show you how to find subarray with given sum. Also, how to implement this in different programming languages.\n","protected":false},"author":21,"featured_media":16246,"template":"","meta":{"_daextam_enable_autolinks":"","web_stories_products":[],"web_stories_publisher_logo":1082,"web_stories_poster":[]},"web_story_category":[1944],"web_story_tag":[2392],"amp_enabled":false,"story_data":{"version":46,"pages":[{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":247,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"8713361c-f03a-487f-9a51-a0f98b9ddadb","scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#0c2640","blurHash":"L32F_aR4MItmROkCt8WAMHo#tmVs","type":"image","mimeType":"image\/jpeg","creationDate":"2018-04-17T10:34:35Z","src":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=2048&h=1536&fit=max","width":2048,"height":1536,"id":"media\/unsplash:oyXis2kALVg","alt":"geometric shape digital wallpaper","sizes":{"full":{"file":"media\/unsplash:oyXis2kALVg","sourceUrl":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=2048&h=1536&fit=max","mimeType":"image\/jpeg","width":2048,"height":1536},"large":{"file":"media\/unsplash:oyXis2kALVg","sourceUrl":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=1638&h=1229&fit=max","mimeType":"image\/jpeg","width":1638,"height":1229},"1228_921":{"file":"media\/unsplash:oyXis2kALVg","sourceUrl":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=1228&h=921&fit=max","mimeType":"image\/jpeg","width":1228,"height":921},"819_614":{"file":"media\/unsplash:oyXis2kALVg","sourceUrl":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=819&h=614&fit=max","mimeType":"image\/jpeg","width":819,"height":614},"409_307":{"file":"media\/unsplash:oyXis2kALVg","sourceUrl":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=409&h=307&fit=max","mimeType":"image\/jpeg","width":409,"height":307},"web_stories_thumbnail":{"file":"media\/unsplash:oyXis2kALVg","sourceUrl":"https:\/\/images.unsplash.com\/photo-1523961131990-5ea7c61b2107?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=340&h=255&fit=max","mimeType":"image\/jpeg","width":340,"height":255}},"attribution":{"author":{"displayName":"fabio","url":"https:\/\/unsplash.com\/@fabioha?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AXhJFEce%2BzWZmFhsx%2BwKiMk\/TFXpJ1tVoa1hIN%2BDsa2yY1QPy7IzOuDP0Lpq%2BWC4PfcYVTdKXcdjn3e8QHkxqHyYukjVlhRB%2Bb0XtSZ\/l9REc3wmE8jmw6MHTFZpVDZ2UBowVcJzY3c8UkrIYQ6IXxjYGK5G3BMTfOea2Vx2h5lDFGHp7WHpCvFFad5PzzFm2ysgK0srrUclNhvCpb7QbkLG4rJJzeneTzBvjfuqUcMyVE4K6hc%3D"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"overlay":{"type":"linear","rotation":0,"stops":[{"color":{"r":0,"g":0,"b":0,"a":0},"position":0.4},{"color":{"r":0,"g":0,"b":0,"a":1},"position":1}],"alpha":0.5}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"bcb61e91-e319-4af6-9942-761a6dccae4d","id":"96332792-fe49-4105-a90e-4f4a9d61ad55","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Roboto"},"fontSize":50,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"font-weight: 700; color: #fff\">How to Find Subarray with Given Sum?<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"x":22,"y":336,"width":316,"height":158,"basedOn":"d3a60bc4-7153-47e4-b0a7-e025488ebee6","id":"95a17566-0eff-4d0a-a9a1-c1eab9f25976","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Roboto"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1.2,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"color: #347eff\">A Quick Guide<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"x":23,"y":501,"width":376,"height":35,"basedOn":"e5b0ef4a-2875-4ea0-b76a-2e4842af3a52","id":"cd5e9604-8a06-49c9-ac81-19784a284f87","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":false,"scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#c9c9c9","type":"image","mimeType":"image\/gif","creationDate":"2021-06-15T20:48:37Z","src":"https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAi\/arrow.gif","width":127,"height":96,"id":"media\/tenor:17502271734916881333","alt":"Arrow Sticker","sizes":{"full":{"file":"media\/tenor:17502271734916881333","sourceUrl":"https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAi\/arrow.gif","mimeType":"image\/gif","width":127,"height":96},"large":{"file":"media\/tenor:17502271734916881333","sourceUrl":"https:\/\/c.tenor.com\/8uSPaXIUm7UAAAAq\/tenor.gif","mimeType":"image\/gif","width":127,"height":96},"127_96":{"file":"media\/tenor:17502271734916881333","sourceUrl":"https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAj\/arrow.gif","mimeType":"image\/gif","width":127,"height":96},"web_stories_thumbnail":{"file":"media\/tenor:17502271734916881333","sourceUrl":"https:\/\/media.tenor.com\/8uSPaXIUm7UAAAAk\/arrow.gif","mimeType":"image\/gif","width":90,"height":68}},"attribution":{"author":{"displayName":"BaqueG","url":"https:\/\/tenor.com\/users\/BaqueG"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AWJwhCGn%2BblUDo95R408YCZKIfyn7yyguspEYe\/\/fKJgzBIWZN0ChVCN8Rsn9SkHv8fUjZj07Pze7bYjLhpJnosB5yKEcbo%3D"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"x":16,"y":561,"width":149,"height":88,"mask":{"type":"rectangle","showInLibrary":true,"name":"Rectangle","path":"M 0,0 1,0 1,1 0,1 0,0 Z","ratio":1,"supportsBorder":true},"basedOn":"3f59b2d3-ad4a-43b4-af04-92e0f580c1f9","id":"1635eb8e-c97a-4bdf-98ea-5a430567b7fd","type":"image"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"id":"d1e9a7c2-404d-415a-a2eb-eea40554940b","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"0261f38d-d8bd-4b47-9896-610bb81df005"},"animations":[]},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":220,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"76638dd5-e923-4c37-8934-99f03447a159","scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#262626","blurHash":"LFAmC_58$%I:~VE2t8W?WrflIo%1","type":"image","mimeType":"image\/jpeg","creationDate":"2019-11-07T22:13:50Z","src":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","width":6016,"height":4016,"id":"media\/unsplash:L85a1k-XqH8","alt":"woman in black shirt using laptop computer","sizes":{"full":{"file":"media\/unsplash:L85a1k-XqH8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","mimeType":"image\/jpeg","width":6016,"height":4016},"large":{"file":"media\/unsplash:L85a1k-XqH8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=4812&h=3212&fit=max","mimeType":"image\/jpeg","width":4812,"height":3212},"3609_2409":{"file":"media\/unsplash:L85a1k-XqH8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=3609&h=2409&fit=max","mimeType":"image\/jpeg","width":3609,"height":2409},"2406_1606":{"file":"media\/unsplash:L85a1k-XqH8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=2406&h=1606&fit=max","mimeType":"image\/jpeg","width":2406,"height":1606},"1203_803":{"file":"media\/unsplash:L85a1k-XqH8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=1203&h=803&fit=max","mimeType":"image\/jpeg","width":1203,"height":803},"web_stories_thumbnail":{"file":"media\/unsplash:L85a1k-XqH8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164713712-03790a178651?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzNXx8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY2NjM2MDY5Ng&ixlib=rb-4.0.3&fm=jpg&w=340&h=227&fit=max","mimeType":"image\/jpeg","width":340,"height":227}},"attribution":{"author":{"displayName":"Christina @ wocintechchat.com","url":"https:\/\/unsplash.com\/@wocintechchat?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AQBR4tpUK7LmuVs8hywyG7ZNT\/IANFQMT5EQVFmKXUhmFGJLcYOybJyAHjY5cN7LFcg7\/au35WOJNwQa8eFQErZFjDPC09pKVbcd7nFwi4Dne6aJ\/agIcZvksCWUxhFQRuXH8Lqv89gRqDmAwh1d0MLN\/9e6EOXZ\/1n4ZlYPaSWSIHgSXZJvPnoi8FQcrOShyJqInuAHqCREV07vTahGggYgiw\/MG1Clw7Kbb%2BGCxpQYdAzcxRorXs5\/MGm4\/d5uHS8vkKrc"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"61b32cde-1c85-4a55-adbb-d0e5621c0185","id":"a3bb84b5-e208-4e2a-936f-5611c92d7d16","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"color: #fff\">Are you searching for a method to find a subarray that adds up to a specific sum? Look no further! &nbsp;&nbsp;<\/span>\n\n<span style=\"color: #347eff\">Let\u2019s explore different methods to find subarrays with a given sum.<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":356,"height":251,"basedOn":"f97fd49e-97ee-4616-af20-f3080ddf1fb7","x":28,"y":213,"groupId":null,"id":"01463911-9ace-441d-a6f8-4307552a5552","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"c31d02c8-b413-4318-a5d0-16b804300858","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0,"targets":["01463911-9ace-441d-a6f8-4307552a5552"]},{"id":"9378c669-de46-4b31-8918-7ba002c39f3e","type":"effect-background-zoom","zoomDirection":"scaleOut","duration":2000,"delay":0,"targets":["76638dd5-e923-4c37-8934-99f03447a159"]}],"id":"ae40903e-5d0a-4461-bb14-d9db3bfd6b21","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"01a3f12e-8e51-4c1f-a11e-a008881031f6"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/Josephus-Problem.png","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":220,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"76638dd5-e923-4c37-8934-99f03447a159","scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#f3f3f3","blurHash":"LWMZ{[?wH?%g?ufmo|x]v}Nw-pW;","type":"image","mimeType":"image\/jpeg","creationDate":"2019-11-07T22:10:23Z","src":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","width":6016,"height":4016,"id":"media\/unsplash:UcZcsHSp8o4","alt":"photography of three women sits beside table inside room during daytime","sizes":{"full":{"file":"media\/unsplash:UcZcsHSp8o4","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","mimeType":"image\/jpeg","width":6016,"height":4016},"large":{"file":"media\/unsplash:UcZcsHSp8o4","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=4812&h=3212&fit=max","mimeType":"image\/jpeg","width":4812,"height":3212},"3609_2409":{"file":"media\/unsplash:UcZcsHSp8o4","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=3609&h=2409&fit=max","mimeType":"image\/jpeg","width":3609,"height":2409},"2406_1606":{"file":"media\/unsplash:UcZcsHSp8o4","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=2406&h=1606&fit=max","mimeType":"image\/jpeg","width":2406,"height":1606},"1203_803":{"file":"media\/unsplash:UcZcsHSp8o4","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=1203&h=803&fit=max","mimeType":"image\/jpeg","width":1203,"height":803},"web_stories_thumbnail":{"file":"media\/unsplash:UcZcsHSp8o4","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574397-dd250bc8a598?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw3OHx8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjcwMzM2Mjk2&ixlib=rb-4.0.3&fm=jpg&w=340&h=227&fit=max","mimeType":"image\/jpeg","width":340,"height":227}},"attribution":{"author":{"displayName":"Christina @ wocintechchat.com","url":"https:\/\/unsplash.com\/@wocintechchat?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AWJwhCECO\/YKgPJJp2cmQoF6fUCVlaVawJi1ntit\/8j7ClCj7cknUXKaOpOp1thzacWJX4pSUqZ9Y4fmKuDsNeyKx0XmP30KEVz1kWhBqH4iEXS8SDPA\/RxBUrcYV0DlIj4xoeNyBGn\/B5NXfm\/1TL01QkeZrI7Gtv1WSwTL6DhBA7Uc3OHvyaOY2XzssGoVYPC%2BBYvcw3Inmf9P4%2BUsso64vm\/JnRKnuabILESqBgWi5devJHX2fmloIpytkA4Zh\/E5HA%3D%3D"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"a3bb84b5-e208-4e2a-936f-5611c92d7d16","id":"90701d05-70b8-48ba-9066-72199e99b3ce","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"color: #fff\">Given an array of integers, the goal is to locate a non-empty subarray that adds up to the specified sum.&nbsp;<\/span>\n\n<span style=\"color: #347eff\">Sound complicated?&nbsp;<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":352,"height":190,"basedOn":"94bfec13-62c1-4925-8c9b-5e13821d634a","x":30,"y":217,"groupId":null,"id":"beb9cd08-b670-4372-bebb-c5ab5af8e430","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"FILL","font":{"family":"Darker Grotesque"},"fontSize":47,"backgroundColor":{"color":{"r":5,"g":34,"b":88}},"lineHeight":0.9,"textAlign":"center","padding":{"locked":true,"hasHiddenPadding":true,"horizontal":8,"vertical":4},"content":"<span style=\"font-weight: 700; color: #3372e0\">Problem Statement<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"x":0,"y":29,"width":410,"height":72,"marginOffset":-33.45600000000001,"basedOn":"bf868b6a-256e-480a-bfe1-970aef991286","groupId":null,"id":"474ddcc5-f7c3-4dc9-a20c-3f6b657b137f","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"0982aa78-ae67-43a7-a657-68a501969d69","type":"effect-background-zoom","zoomDirection":"scaleOut","duration":2000,"delay":0,"targets":["76638dd5-e923-4c37-8934-99f03447a159"]},{"id":"125d0481-b8ed-4e8a-a717-01c0d72336d0","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0,"targets":["beb9cd08-b670-4372-bebb-c5ab5af8e430"]},{"targets":["474ddcc5-f7c3-4dc9-a20c-3f6b657b137f"],"id":"cb3b7d74-4313-48a1-88bf-9b506e70d824","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0}],"id":"89c46d12-909f-4a7b-b582-777f409a4ac2","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"283242a8-1ccf-4e4a-b65c-4ffac79f766a"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":220,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"76638dd5-e923-4c37-8934-99f03447a159","scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#d9d9d9","blurHash":"LjK^yzv|NGt6_NWBoKxubckqIobc","type":"image","mimeType":"image\/jpeg","creationDate":"2019-11-07T22:10:23Z","src":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","width":6016,"height":4016,"id":"media\/unsplash:rg1y72eKw6o","alt":"photography of people inside room during daytime","sizes":{"full":{"file":"media\/unsplash:rg1y72eKw6o","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","mimeType":"image\/jpeg","width":6016,"height":4016},"large":{"file":"media\/unsplash:rg1y72eKw6o","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=4812&h=3212&fit=max","mimeType":"image\/jpeg","width":4812,"height":3212},"3609_2409":{"file":"media\/unsplash:rg1y72eKw6o","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=3609&h=2409&fit=max","mimeType":"image\/jpeg","width":3609,"height":2409},"2406_1606":{"file":"media\/unsplash:rg1y72eKw6o","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=2406&h=1606&fit=max","mimeType":"image\/jpeg","width":2406,"height":1606},"1203_803":{"file":"media\/unsplash:rg1y72eKw6o","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=1203&h=803&fit=max","mimeType":"image\/jpeg","width":1203,"height":803},"web_stories_thumbnail":{"file":"media\/unsplash:rg1y72eKw6o","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573164574511-73c773193279?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxMDh8fHNvZnR3YXJlJTIwZGV2ZWxvcGVyfGVufDB8fHx8MTY3MDMzNjMzMA&ixlib=rb-4.0.3&fm=jpg&w=340&h=227&fit=max","mimeType":"image\/jpeg","width":340,"height":227}},"attribution":{"author":{"displayName":"Christina @ wocintechchat.com","url":"https:\/\/unsplash.com\/@wocintechchat?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AWJwhCFcgWOB8O4wGdNrsMGyJwnTqyKLehN0FuFqNYyrxJVXxXJq6rfp7OjoSTDQSEVFYBxu3UXDi743W3AyZLSELiTtzAmW9z4CAmO7oz43orQ9AeVnbJo4y%2BuzJSaFtpX9g6vNSND\/XvDGQt35uPVoN9p0k%2Bd8vqKaRRBHy4ntdzXQuSjcaktuxqRXc2ygb3zDeJmS6JkbU9%2BzDZiKse2zeMQYh1w9B8S12rvNZM\/2hfCY11iO\/X0W4FRBkFOXiqCnBuE8"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"90701d05-70b8-48ba-9066-72199e99b3ce","id":"ca607fc3-47ce-46f2-be0f-336346011aab","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"font-weight: 700; color: #347eff\">Example- &nbsp;<\/span>\n\n<span style=\"font-weight: 700; color: #fff\">Input:<\/span><span style=\"color: #fff\"> [11, 9, 8, 7, 13, 5, 17]&nbsp;<\/span>\n\n<span style=\"font-weight: 700; color: #fff\">Sum: <\/span><span style=\"color: #fff\">25 &nbsp;<\/span>\n\n<span style=\"font-weight: 700; color: #fff\">Output: <\/span><span style=\"color: #fff\">YES&nbsp;<\/span>\n\n<span style=\"font-weight: 700; color: #fff\">Explanation: <\/span><span style=\"color: #fff\">The subarray [7, 13, 5] adds up to 25.&nbsp;<\/span>\n","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":348,"height":341,"basedOn":"94bfec13-62c1-4925-8c9b-5e13821d634a","x":31,"y":149,"groupId":null,"id":"91e1f96d-98c1-4640-bbd8-2ceb2f611100","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"d1757342-184c-48e6-a327-1672fa4c6095","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0,"targets":["91e1f96d-98c1-4640-bbd8-2ceb2f611100"]},{"id":"131e3b65-acd7-4888-9d8b-d6d7b74aae20","type":"effect-background-zoom","zoomDirection":"scaleOut","duration":2000,"delay":0,"targets":["76638dd5-e923-4c37-8934-99f03447a159"]}],"id":"de3e1538-90d1-44c3-9dc1-e9eb15aea441","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"27f2951c-8b6e-4772-8cc9-8a5b431fd5c6"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":220,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"27f2951c-8b6e-4772-8cc9-8a5b431fd5c6","scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#f3a673","blurHash":"LjL|T1tTAvs9pytR-oRj%3WXadae","type":"image","mimeType":"image\/jpeg","creationDate":"2019-11-07T22:31:26Z","src":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","width":6016,"height":4016,"id":"media\/unsplash:eS72kLFS6s0","alt":"people sitting beside rectangular brown table with laptops","sizes":{"full":{"file":"media\/unsplash:eS72kLFS6s0","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","mimeType":"image\/jpeg","width":6016,"height":4016},"large":{"file":"media\/unsplash:eS72kLFS6s0","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=4812&h=3212&fit=max","mimeType":"image\/jpeg","width":4812,"height":3212},"3609_2409":{"file":"media\/unsplash:eS72kLFS6s0","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=3609&h=2409&fit=max","mimeType":"image\/jpeg","width":3609,"height":2409},"2406_1606":{"file":"media\/unsplash:eS72kLFS6s0","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=2406&h=1606&fit=max","mimeType":"image\/jpeg","width":2406,"height":1606},"1203_803":{"file":"media\/unsplash:eS72kLFS6s0","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=1203&h=803&fit=max","mimeType":"image\/jpeg","width":1203,"height":803},"web_stories_thumbnail":{"file":"media\/unsplash:eS72kLFS6s0","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165759995-5865a394a1aa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw2M3x8c29mdHdhcmUlMjBkZXZlbG9wZXJ8ZW58MHx8fHwxNjY5OTAyNjU0&ixlib=rb-4.0.3&fm=jpg&w=340&h=227&fit=max","mimeType":"image\/jpeg","width":340,"height":227}},"attribution":{"author":{"displayName":"Christina @ wocintechchat.com","url":"https:\/\/unsplash.com\/@wocintechchat?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AWJwhCHWU%2BqKzAr8\/GMMQVqPspJuX\/C4Xn4rECmLCV93N90uMAWDH%2BKbqdnoOqXHGHKDD7ORnoiR6GvvJ7v0RNNjP3nS4zANKxaEwC4Bhg6YKPudMdd2JHUfoWW01GGoGeh7mk2drSQJAZoy2Ygz8%2BumHKJ6UoMmf18E4cxvxK0IkDv3ea6ziG0wErS304bHYKpDsaB5zdJdI1LqNlnevp1o60i00RsEq5aP\/1KdyXWyarkr95ZXY3ragEV1iFhrOJmonA%3D%3D"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"ca607fc3-47ce-46f2-be0f-336346011aab","id":"f24b57dc-e5b9-416a-be22-4a071ebd4794","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"FILL","font":{"family":"Darker Grotesque"},"fontSize":47,"backgroundColor":{"color":{"r":5,"g":34,"b":88}},"lineHeight":0.9,"textAlign":"center","padding":{"locked":true,"hasHiddenPadding":true,"horizontal":8,"vertical":4},"content":"<span style=\"font-weight: 700; color: #3372e0\">Approach 1-&nbsp;<\/span>\n<span style=\"font-weight: 700; color: #3372e0\">Naive Approach<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"x":0,"y":29,"width":410,"height":114,"marginOffset":-33.45600000000001,"basedOn":"9b799116-f7f3-4f88-aafc-d52d5a3ec37c","groupId":null,"id":"8fb0e3eb-6cd5-42d7-8885-accf73ddaeed","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"color: #fff\">The naive approach involves checking every single subarray for the given sum. Are you ready to see it in action?<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":348,"height":130,"basedOn":"91e1f96d-98c1-4640-bbd8-2ceb2f611100","x":32,"y":232,"groupId":null,"id":"e8aea5b7-d448-4343-8e51-1d97745db66a","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"716e5d49-d654-4dca-86d2-fcf61887a02d","type":"effect-background-zoom","zoomDirection":"scaleOut","duration":2000,"delay":0,"targets":["27f2951c-8b6e-4772-8cc9-8a5b431fd5c6"]},{"targets":["8fb0e3eb-6cd5-42d7-8885-accf73ddaeed"],"id":"1ed26af6-f163-45af-ac87-2f4a05921fc9","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0},{"id":"a2779321-f3f3-4a26-9aa0-5d2eff046b70","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0,"targets":["e8aea5b7-d448-4343-8e51-1d97745db66a"]}],"id":"9e5d6a53-c17c-415a-b590-e6df6d6fd3f4","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"0173d9f5-2320-425e-80b2-65ec1d738f9c"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/Josephus-Problem.png","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":220,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"4bea2dab-2033-49a6-a9a8-b6dc345abb9c","scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/jpeg","width":6016,"height":4016,"sizes":{"full":{"file":"media\/unsplash:c6wbSBaYxkY","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","mimeType":"image\/jpeg","width":6016,"height":4016},"large":{"file":"media\/unsplash:c6wbSBaYxkY","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=4812&h=3212&fit=max","mimeType":"image\/jpeg","width":4812,"height":3212},"3609_2409":{"file":"media\/unsplash:c6wbSBaYxkY","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=3609&h=2409&fit=max","mimeType":"image\/jpeg","width":3609,"height":2409},"2406_1606":{"file":"media\/unsplash:c6wbSBaYxkY","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=2406&h=1606&fit=max","mimeType":"image\/jpeg","width":2406,"height":1606},"1203_803":{"file":"media\/unsplash:c6wbSBaYxkY","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=1203&h=803&fit=max","mimeType":"image\/jpeg","width":1203,"height":803},"web_stories_thumbnail":{"file":"media\/unsplash:c6wbSBaYxkY","sourceUrl":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=340&h=227&fit=max","mimeType":"image\/jpeg","width":340,"height":227}},"isPlaceholder":false,"isExternal":true,"needsProxy":false,"id":"media\/unsplash:c6wbSBaYxkY","baseColor":"#262626","blurHash":"LfHBSZwatRI;~UM_t8Rj-URjM|R+","creationDate":"2019-11-07T22:31:26Z","src":"https:\/\/images.unsplash.com\/photo-1573165706511-3ffde6ef1fe3?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwxM3x8c29mdHdhcmUlMjBkZXZlbG9wZXJzfGVufDB8fHx8MTY3MjkyMDQ4OQ&ixlib=rb-4.0.3&fm=jpg&w=6016&h=4016&fit=max","alt":"three women sitting beside wooden table","attribution":{"author":{"displayName":"Christina @ wocintechchat.com","url":"https:\/\/unsplash.com\/@wocintechchat?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AXhJFEdJpTQhya4OyY%2BSgPEGH7SB9a7rv6KzX%2BLUgwsFBBCS5p2fKkkeyAnOO%2BapZ7ma1hu2eyb0o9We1ppDCrG%2Be9T2DOt3L59vhxPv%2Bors17KeKHuhGecyOcuAa%2B8R9aumrDhldwtVTsPDzJh9xGbuEquFMePRQwPOekDh5783\/eLbiOEvr\/Bze8rAvuzAweCNSznvK3KroG2wvXYXWIXYCPL6lU80P9f5xcntvK06ygFxUPe1hKUrjII3VNGIjFvUPjao"}},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"f24b57dc-e5b9-416a-be22-4a071ebd4794","id":"2ad5ac42-0aab-4934-a886-dd828e311d1a","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"font-weight: 700; color: #347eff\">Time complexity: <\/span><span style=\"color: #fff\">O(N^2), where N is the size of the array.&nbsp;<\/span>\n\n<span style=\"font-weight: 700; color: #347eff\">Space complexity: <\/span><span style=\"color: #fff\">O(1)<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":352,"height":130,"basedOn":"9cdf83be-84a7-4e37-9e13-228230d7f1b6","x":30,"y":213,"groupId":null,"id":"10752c12-70a7-4a16-8ef9-0e5287245dc9","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"a085bb41-cadd-41ec-8f93-9404e9f53204","type":"effect-background-zoom","zoomDirection":"scaleOut","duration":2000,"delay":0,"targets":["4bea2dab-2033-49a6-a9a8-b6dc345abb9c"]},{"id":"1ed8c261-1b0e-4640-8245-82ecc9d30abe","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0,"targets":["10752c12-70a7-4a16-8ef9-0e5287245dc9"]}],"id":"cf434d3e-3132-4b3c-87e0-5ae80860d37a","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"07cb1230-628a-4b45-910c-b13bf7f662ea"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":439,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"07cb1230-628a-4b45-910c-b13bf7f662ea","scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/jpeg","width":2707,"height":3608,"sizes":{"full":{"file":"media\/unsplash:xTHcNZAQzbM","sourceUrl":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=2707&h=3608&fit=max","mimeType":"image\/jpeg","width":2707,"height":3608},"large":{"file":"media\/unsplash:xTHcNZAQzbM","sourceUrl":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=2165&h=2886&fit=max","mimeType":"image\/jpeg","width":2165,"height":2886},"1624_2165":{"file":"media\/unsplash:xTHcNZAQzbM","sourceUrl":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=1624&h=2165&fit=max","mimeType":"image\/jpeg","width":1624,"height":2165},"1082_1442":{"file":"media\/unsplash:xTHcNZAQzbM","sourceUrl":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=1082&h=1442&fit=max","mimeType":"image\/jpeg","width":1082,"height":1442},"541_721":{"file":"media\/unsplash:xTHcNZAQzbM","sourceUrl":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=541&h=721&fit=max","mimeType":"image\/jpeg","width":541,"height":721},"web_stories_thumbnail":{"file":"media\/unsplash:xTHcNZAQzbM","sourceUrl":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=340&h=453&fit=max","mimeType":"image\/jpeg","width":340,"height":453}},"isPlaceholder":false,"isExternal":true,"needsProxy":false,"id":"media\/unsplash:xTHcNZAQzbM","baseColor":"#a6c0c0","blurHash":"LIHog[%~0#?c;]0LXS_2XnnK#ktR","creationDate":"2020-02-19T19:00:28Z","src":"https:\/\/images.unsplash.com\/photo-1582138825658-fb952c08b282?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHw0NHx8amF2YSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzMwMDg0NzY&ixlib=rb-4.0.3&fm=jpg&w=2707&h=3608&fit=max","alt":"man in blue hoodie looking at macbook","attribution":{"author":{"displayName":"Muha Ajjan","url":"https:\/\/unsplash.com\/@isword?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AXhJFEcEY%2BT7c0qTV1kZVyncP1bslVbnc1dE7RsCCOxz2qoRLxJrmb7JVftbWn%2BZ5HCst6ZrN5RASgilHjFmh\/NokkrOX%2BYHinbYI2pESFPJl4vVJkQCvYE3GumNPGxnxtYHDatbuYeb%2BBO5%2BEH2xylRdagcyIQbaO3bb1KYXRl%2BZNnCRR4dqB0\/TLmgERYMQaruO8DfuHJeATfU7cTkhG7UElOwWk%2Bn0goYHsDPl0zfj\/AUuzEcctZ8\/YvKdts%3D"}},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"41a8dcee-ac6c-4e09-becf-468b8665bb19","id":"ddd85b20-5151-46db-b5aa-6c37b1273284","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"color: #fff\">Speed up your search for the perfect subarray with this approach. It involves taking an empty window and adjusting it until the given constraint is satisfied. &nbsp;<\/span>\n\n<span style=\"color: #347eff\">Ready to see how it works? Check out the algorithm!<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":352,"height":281,"basedOn":"d2221497-d2ea-45d3-8599-eaabe9e325ef","x":30,"y":225,"groupId":null,"id":"5a80f896-83ce-48d0-b555-413c716f09c1","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"FILL","font":{"family":"Darker Grotesque"},"fontSize":47,"backgroundColor":{"color":{"r":5,"g":34,"b":88}},"lineHeight":0.9,"textAlign":"center","padding":{"locked":true,"hasHiddenPadding":true,"horizontal":8,"vertical":4},"content":"<span style=\"font-weight: 700; color: #3372e0\">Approach 2-&nbsp;<\/span>\n<span style=\"font-weight: 700; color: #3372e0\">Sliding window<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"x":0,"y":29,"width":410,"height":114,"marginOffset":-33.45600000000001,"basedOn":"48410877-ae3e-4439-b2d8-0dd4db19b77f","groupId":null,"id":"f7104d53-7c22-4289-abb4-0c197e2adb73","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"f1474678-2664-42cc-841f-856a33508eaf","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0,"targets":["5a80f896-83ce-48d0-b555-413c716f09c1"]},{"id":"cbfe5f2d-e577-4a06-82ee-75b0f55761ff","type":"effect-background-zoom","zoomDirection":"scaleOut","duration":2000,"delay":0,"targets":["07cb1230-628a-4b45-910c-b13bf7f662ea"]},{"targets":["f7104d53-7c22-4289-abb4-0c197e2adb73"],"id":"d6ccbaf0-546a-47c6-a5b7-bfb78270107d","type":"effect-zoom","scaleDirection":"scaleIn","duration":2000,"delay":0}],"id":"015ce16c-01eb-4503-a5fd-c69fd2ace5d2","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"abc994fd-18e5-4821-9439-6a805f711046"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/Josephus-Problem.png","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":219,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"07cb1230-628a-4b45-910c-b13bf7f662ea","scale":100,"focalX":50,"focalY":50,"resource":{"baseColor":"#0c2626","blurHash":"L33[xbocMwRkIUWAayof4ma#xvt6","type":"image","mimeType":"image\/jpeg","creationDate":"2015-12-27T03:41:04Z","src":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=4256&h=2832&fit=max","width":4256,"height":2832,"id":"media\/unsplash:Q1p7bh3SHj8","alt":"photo of outer space","sizes":{"full":{"file":"media\/unsplash:Q1p7bh3SHj8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=4256&h=2832&fit=max","mimeType":"image\/jpeg","width":4256,"height":2832},"large":{"file":"media\/unsplash:Q1p7bh3SHj8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=3404&h=2265&fit=max","mimeType":"image\/jpeg","width":3404,"height":2265},"2553_1699":{"file":"media\/unsplash:Q1p7bh3SHj8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=2553&h=1699&fit=max","mimeType":"image\/jpeg","width":2553,"height":1699},"1702_1133":{"file":"media\/unsplash:Q1p7bh3SHj8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=1702&h=1133&fit=max","mimeType":"image\/jpeg","width":1702,"height":1133},"851_566":{"file":"media\/unsplash:Q1p7bh3SHj8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=851&h=566&fit=max","mimeType":"image\/jpeg","width":851,"height":566},"web_stories_thumbnail":{"file":"media\/unsplash:Q1p7bh3SHj8","sourceUrl":"https:\/\/images.unsplash.com\/photo-1451187580459-43490279c0fa?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxiaWclMjBkYXRhfGVufDB8fHx8MTY3MjY2MDQyNA&ixlib=rb-4.0.3&fm=jpg&w=340&h=226&fit=max","mimeType":"image\/jpeg","width":340,"height":226}},"attribution":{"author":{"displayName":"NASA","url":"https:\/\/unsplash.com\/@nasa?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=AXhJFEcXHBQIrntAg6HooRUw5WXm7AxzRvs5HbuFuQN8QDw3Ai0kjzjMRQlR%2B1thZZL4roDPCOHwuZcp9O6zjxy9M6fH\/O2EZBkyr14DGGNtIxmkhy6AYPH8Y9vuDiwCgt8kSoj1hkEwYCWfdgp0BluVCg9E08f1HosZr1o%2Ba1LbjJXB%2Bqr\/KxEnWUM2yo06bmnbJyVBRTJLgXBxyjQ77WP3USIywZS9HBCRQihgsJKGoWP9Za4%3D"},"isPlaceholder":false,"isOptimized":false,"isMuted":false,"isExternal":true,"needsProxy":false},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.4}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"2ad5ac42-0aab-4934-a886-dd828e311d1a","id":"380e77ec-becc-4e13-b03c-a3c1bed377c3","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Darker Grotesque"},"fontSize":30,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"font-weight: 700; color: #347eff\">Click on the link below to start your journey.<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":358,"height":71,"basedOn":"68dc11dc-e204-44c0-b174-4c7e4f8d8ead","x":21,"y":420,"groupId":null,"id":"faf98ac9-3bde-42ce-ba57-b4ed553c9aaf","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Merriweather"},"fontSize":43,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false},"content":"<span style=\"font-weight: 700; color: #fff\">Are you ready to level up your coding skills?<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"width":300,"height":183,"basedOn":"353bbb13-e16d-4b48-b987-df0f080f5122","x":21,"y":237,"tagName":"h2","groupId":null,"marginOffset":-12.078999999999994,"id":"6bcfeeb7-4083-4a82-a8c2-5231fcf41193","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"7c42a0a9-c699-4851-b2cc-efed927d15b4","type":"effect-fly-in","flyInDir":"leftToRight","duration":600,"delay":0,"targets":["faf98ac9-3bde-42ce-ba57-b4ed553c9aaf"]},{"id":"d801bdb7-3da4-4c3b-a9de-4df967161aa4","type":"effect-fly-in","flyInDir":"topToBottom","duration":600,"delay":0,"targets":["6bcfeeb7-4083-4a82-a8c2-5231fcf41193"]}],"id":"936b559d-4dc0-423a-9d89-b4d4ba99b081","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"5e0b0d71-adf4-40a7-b66a-df56c38694fc"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/subarray-with-given-sum\/?utm_source=Ib&utm_medium=webstories&utm_campaign=how-to-find-subarray-with-given-sum","icon":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/10\/15-Subarray-with-given-sum-1.jpg","needsProxy":false,"ctaText":"Click here"}},{"elements":[{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":48,"y":0,"width":330,"height":494,"mask":{"type":"rectangle"},"isBackground":true,"type":"image","id":"5e0b0d71-adf4-40a7-b66a-df56c38694fc","scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/jpeg","width":4000,"height":6000,"sizes":{"full":{"file":"media\/unsplash:VzJjPuk53sk","sourceUrl":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=4000&h=6000&fit=max","mimeType":"image\/jpeg","width":4000,"height":6000},"large":{"file":"media\/unsplash:VzJjPuk53sk","sourceUrl":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=3200&h=4800&fit=max","mimeType":"image\/jpeg","width":3200,"height":4800},"2400_3600":{"file":"media\/unsplash:VzJjPuk53sk","sourceUrl":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=2400&h=3600&fit=max","mimeType":"image\/jpeg","width":2400,"height":3600},"1600_2400":{"file":"media\/unsplash:VzJjPuk53sk","sourceUrl":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=1600&h=2400&fit=max","mimeType":"image\/jpeg","width":1600,"height":2400},"800_1200":{"file":"media\/unsplash:VzJjPuk53sk","sourceUrl":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=800&h=1200&fit=max","mimeType":"image\/jpeg","width":800,"height":1200},"web_stories_thumbnail":{"file":"media\/unsplash:VzJjPuk53sk","sourceUrl":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=340&h=510&fit=max","mimeType":"image\/jpeg","width":340,"height":510}},"isPlaceholder":false,"isExternal":true,"needsProxy":false,"id":"media\/unsplash:VzJjPuk53sk","baseColor":"#0c2626","blurHash":"LBEorfElXSNGBY0g=_IoKQ^*^hxu","creationDate":"2019-11-30T05:00:10Z","src":"https:\/\/images.unsplash.com\/photo-1575089976121-8ed7b2a54265?ixid=MnwxMzcxOTN8MHwxfHNlYXJjaHwzfHxzb2Z0d2FyZSUyMGRldmVsb3BlcnxlbnwwfHx8fDE2NzU5NTEzNTI&ixlib=rb-4.0.3&fm=jpg&w=4000&h=6000&fit=max","alt":"man using laptop","attribution":{"author":{"displayName":"Procreator UX Design Studio","url":"https:\/\/unsplash.com\/@weareprocreator?utm_source=web_stories_wordpress&utm_medium=referral"},"registerUsageUrl":"https:\/\/media3p.googleapis.com\/v1\/media:registerUsage?token=Aa0pnNYbBzh33a64Rn\/GtHM83XD4RghDlBuB7EUvKEVPvUqGZNoeUMMZ0lg812HI\/NPHHpsLdmYmrCKHfTsl7aYi51QF6C5CrhIpz1OEucggYip57nWrbJNdmHn%2BrSq1LZxd9%2Bs9eBplogX4XvOwbL\/EQBHvwpLN9ljSrtW8eDGAfLRXrBgt4NdNK42VEi7T366AD1c8tAhzlTTS4mQ8HILX2DSrJIqbt75J%2BBxwGpcU3FAznWC3xYHbnVDgNmPuHyka"}},"overlay":{"color":{"r":0,"g":0,"b":0,"a":0.5}}},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"scale":100,"focalX":50,"focalY":50,"resource":{"type":"image","mimeType":"image\/png","creationDate":"2021-07-12T14:57:03","src":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png","width":2130,"height":708,"id":724,"alt":"InterviewBit-White-2","sizes":{"medium":{"file":"InterviewBit-White-2-300x100.png","width":300,"height":100,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-300x100.png"},"large":{"file":"InterviewBit-White-2-1024x340.png","width":1024,"height":340,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1024x340.png"},"thumbnail":{"file":"InterviewBit-White-2-150x150.png","width":150,"height":150,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x150.png"},"medium_large":{"file":"InterviewBit-White-2-768x255.png","width":768,"height":255,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-768x255.png"},"1536x1536":{"file":"InterviewBit-White-2-1536x511.png","width":1536,"height":511,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-1536x511.png"},"2048x2048":{"file":"InterviewBit-White-2-2048x681.png","width":2048,"height":681,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-2048x681.png"},"web-stories-poster-portrait":{"file":"InterviewBit-White-2-640x708.png","width":640,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x708.png"},"web-stories-poster-landscape":{"file":"InterviewBit-White-2-853x640.png","width":853,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-853x640.png"},"web-stories-poster-square":{"file":"InterviewBit-White-2-640x640.png","width":640,"height":640,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-640x640.png"},"web-stories-publisher-logo":{"file":"InterviewBit-White-2-96x96.png","width":96,"height":96,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-96x96.png"},"web-stories-thumbnail":{"file":"InterviewBit-White-2-150x50.png","width":150,"height":50,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2-150x50.png"},"full":{"file":"InterviewBit-White-2.png","width":2130,"height":708,"mimeType":"image\/png","sourceUrl":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/07\/InterviewBit-White-2.png"}},"isOptimized":false,"isExternal":false},"x":0,"y":-39,"width":180,"height":60,"mask":{"type":"rectangle"},"basedOn":"380e77ec-becc-4e13-b03c-a3c1bed377c3","id":"14c4f8e1-e8cb-4904-9519-cbcd2f86b4f3","type":"image"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Poppins"},"fontSize":43,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1.1,"textAlign":"initial","padding":{"hasHiddenPadding":false,"horizontal":0,"vertical":0},"x":31,"y":168,"width":364,"height":202,"basedOn":"34d0fabe-700e-4b88-a46d-94236cf499c3","content":"<span style=\"font-weight: 700; color: #fff\">Step Up Your Game with InterviewBit Web Stories<\/span>","tagName":"p","marginOffset":-13.199999999999989,"id":"4a501d26-7978-408e-a405-3aa09dd9488d","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Roboto"},"fontSize":23,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1.2,"textAlign":"left","padding":{"locked":true,"hasHiddenPadding":false,"horizontal":0,"vertical":0},"content":"<span style=\"color: #fff\">Don't miss out on the chance to upskill yourself with IntervewBit's engaging web stories.&nbsp;<\/span>","borderRadius":{"locked":true,"topLeft":2,"topRight":2,"bottomRight":2,"bottomLeft":2},"x":30,"y":370,"width":340,"height":82,"basedOn":"0736d960-c8c0-4128-801c-c74dec981ccb","id":"059b3c60-05fd-4f35-a8b6-7e0f46822ae8","type":"text"},{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundTextMode":"NONE","font":{"family":"Poppins"},"fontSize":202,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"lineHeight":1,"textAlign":"initial","padding":{"horizontal":0,"vertical":0},"x":20,"y":27,"width":81,"height":283,"basedOn":"32917c1b-803f-418c-ba36-40014197eb29","content":"<span style=\"font-weight: 700; color: #fff\">\u201c<\/span>","id":"e0a006e6-161a-41fd-bd99-ad9adeb2d6a5","type":"text"}],"backgroundColor":{"color":{"r":255,"g":255,"b":255}},"animations":[{"id":"cbd1a530-143c-45f4-b309-65c3ae806436","type":"effect-fly-in","flyInDir":"topToBottom","duration":1000,"delay":0,"targets":["4a501d26-7978-408e-a405-3aa09dd9488d"]},{"id":"170b0dd7-75d3-4d23-a735-c901c039a7c1","type":"effect-fly-in","flyInDir":"topToBottom","duration":600,"delay":0,"targets":["059b3c60-05fd-4f35-a8b6-7e0f46822ae8"]}],"id":"736f464b-c940-47d7-a25d-3cfd57bdec11","defaultBackgroundElement":{"opacity":100,"flip":{"vertical":false,"horizontal":false},"rotationAngle":0,"lockAspectRatio":true,"backgroundColor":{"color":{"r":196,"g":196,"b":196}},"x":1,"y":1,"width":1,"height":1,"mask":{"type":"rectangle"},"isBackground":true,"isDefaultBackground":true,"type":"shape","id":"2e578b1c-8afc-4d50-aa8d-ac3d624b2d37"},"pageAttachment":{"url":"https:\/\/www.interviewbit.com\/blog\/web-stories\/?utm_source=Ib&utm_medium=webstories&utm_campaign=unlimited-learning-with-engaging-web-stories","icon":"","needsProxy":false,"ctaText":"SWIPE UP"}}],"fonts":{"Roboto":{"family":"Roboto","fallbacks":["sans-serif"],"weights":[100,300,400,500,700,900],"styles":["italic","regular"],"variants":[[0,100],[1,100],[0,300],[1,300],[0,400],[1,400],[0,500],[1,500],[0,700],[1,700],[0,900],[1,900]],"service":"fonts.google.com","metrics":{"upm":2048,"asc":1900,"des":-500,"tAsc":1536,"tDes":-512,"tLGap":102,"wAsc":1946,"wDes":512,"xH":1082,"capH":1456,"yMin":-555,"yMax":2163,"hAsc":1900,"hDes":-500,"lGap":0}},"Darker Grotesque":{"family":"Darker Grotesque","fallbacks":["sans-serif"],"weights":[300,400,500,600,700,800,900],"styles":["regular"],"variants":[[0,300],[0,400],[0,500],[0,600],[0,700],[0,800],[0,900]],"service":"fonts.google.com","metrics":{"upm":1000,"asc":1060,"des":-296,"tAsc":1060,"tDes":-296,"tLGap":0,"wAsc":1060,"wDes":296,"xH":406,"capH":563,"yMin":-296,"yMax":1060,"hAsc":1060,"hDes":-296,"lGap":0}},"Merriweather":{"family":"Merriweather","fallbacks":["serif"],"weights":[300,400,700,900],"styles":["italic","regular"],"variants":[[0,300],[1,300],[0,400],[1,400],[0,700],[1,700],[0,900],[1,900]],"service":"fonts.google.com","metrics":{"upm":1000,"asc":984,"des":-273,"tAsc":984,"tDes":-273,"tLGap":0,"wAsc":1065,"wDes":273,"xH":555,"capH":743,"yMin":-272,"yMax":1055,"hAsc":984,"hDes":-273,"lGap":0}},"Poppins":{"family":"Poppins","fallbacks":["sans-serif"],"weights":[100,200,300,400,500,600,700,800,900],"styles":["italic","regular"],"variants":[[0,100],[1,100],[0,200],[1,200],[0,300],[1,300],[0,400],[1,400],[0,500],[1,500],[0,600],[1,600],[0,700],[1,700],[0,800],[1,800],[0,900],[1,900]],"service":"fonts.google.com","metrics":{"upm":1000,"asc":1050,"des":-350,"tAsc":1050,"tDes":-350,"tLGap":100,"wAsc":1135,"wDes":627,"xH":548,"capH":698,"yMin":-572,"yMax":1065,"hAsc":1050,"hDes":-350,"lGap":100}}},"autoAdvance":true,"defaultPageDuration":7,"currentStoryStyles":{"colors":[]}},"style_presets":{"colors":[{"color":{"r":157,"g":100,"b":32}},{"color":{"r":0,"g":0,"b":0}}],"textStyles":[]},"story_poster":{"id":16246,"url":"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2023\/02\/cropped-week-3-feb-13th-subarray-with-given-sum.png","width":640,"height":853,"needsProxy":false},"_links":{"self":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web-story\/16244"}],"collection":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web-story"}],"about":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/types\/web-story"}],"author":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/users\/21"}],"version-history":[{"count":2,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web-story\/16244\/revisions"}],"predecessor-version":[{"id":16248,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web-story\/16244\/revisions\/16248"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/media\/16246"}],"wp:attachment":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/media?parent=16244"}],"wp:term":[{"taxonomy":"web_story_category","embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web_story_category?post=16244"},{"taxonomy":"web_story_tag","embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web_story_tag?post=16244"}],"wp:lock":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/web-story\/16244\/lock"}],"wp:publisherlogo":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/web-stories\/v1\/media\/1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}