To the Top
File:  root - text - article - 2020 - 01 - subarray-with-target-sum.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 293 Views, 22809 Search Bots | 63 Words

Subscribe to Feed Burner | Browse | Archive
Hi, here's your problem today. This problem was recently asked by Amazon:

You are given an array of integers, and an integer K. Return the subarray which sums to K. You can assume that a solution will always exist.


def find_continuous_k(list, k):
# Fill this in.

print find_continuous_k([1, 3, 2, 5, 7, 2], 14)
# [2, 5, 7]


Can you do this in linear time?
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 293 Views, 22809 Search Bots | 63 Words Subscribe to Feed Burner

Related Articles

  1. Sorting a list with 3 unique numbers
  2. Daily Interview Problem: Buddy Strings
  3. Algorithm Interview: Determine If Linked List is Palindrome
  4. Fibonacci coding
  5. Algorithm Interview: String Compression
  6. Daily Interview Problem: Find the k-th Largest Element in a List
  7. Daily Interview Problem: Largest BST in a Binary Tree
  8. YES!!
  9. Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
  10. Consecutive Ones

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="index, follow">