# Lintcode Problem

solve-leetcode-problems - :notebook_with_decorative_cover: This GitBook contains all the LeetCode problems that I have solved #opensource. I have an array, which is filled with numbers so that it contains empty and non-empty elements and in fact consists of several arrays. Q&A for Work. Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned. 书籍非常具有个人主观性，编程类的书籍也不例外。但是不管书籍的风格，重点或者节奏如何，好的 c++ 编程书能带读者开启一段引人入胜的旅程，拓展 c++ 语言的能力，向读者展示如何使用c++来构建各种东西。. We provide Chinese and …. Given a set of n nuts of different sizes and n bolts of different sizes. com is rated 4. Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Your code should return the length of LCS. 0 by StuffGate. The problem is you cannot really define a good API that works for both of them. com has ranked N/A in N/A and 1,574,833 on the world. Comparison of a nut to another nut or a bolt to another bolt is not allowed. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. It will automatically search solutions for your problems. Powerful coding training system. LintCode Monday, July 13, 2015. Happy Number Data Structure(9) LintCode-40. Congratulations, Your submission is Accepted! Want more practises can filter by difficulty, algorithm and data structure?. Comparison of a nut to another nut or a bolt to another bolt is not allowed. Your code should return the index of the first number and the index of the last number. solve-leetcode-problems - :notebook_with_decorative_cover: This GitBook contains all the LeetCode problems that I have solved #opensource. ️Python ️Scala ️Apache Spark, ️Kafka, AWS EMR, Hive, S3, ️PostgreSQL. LinkedIn Dynamic Programming Subarray. All substrings A appearing in S are replaced by B. String(6) LintCode-32. If the site was up for sale, it would be worth approximately $18,062 USD. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. 这一类问题在海量数据类面试题中出现频率最高. We provide Chinese and. Delete Digits… on Lintcode: delete digits: Leetcode: House Robb… on Leetcode: House Robber: Leetcode: Course Sch… on Lintcode: Topological order: Leetcode: Implement… on Leetcode: Add and Search Word…. Powerful coding training system. com has the potential to earn $2,580 USD in advertisement revenue per year. On one line there are n houses. Given a set of n nuts of different sizes and n bolts of different sizes. Give you an array of integer means the position of each house. Lintcode: Nuts & Bolts Problem quick sort非常好的题。 用bolts[start]将nuts partition成两部分，得到中间值pivot，再用nuts[pivot]将bolts分成两部分。. Give you an array of integer means the the position of each house. There is a one-one mapping between nuts and bolts. Contribute to clairett/Leetcode-Lintcode-Python development by creating an account on GitHub. I'll keep updating for full summary and better solutions. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. Given a set of n nuts of different sizes and n bolts of different sizes. Find k numbers where sum is target. Comparison of a nut to another nut or a bolt to another bolt is not allowed. Analysis: This problem is very similar to the one about valid anagrams. It should support the following operations: get and put. We provide Chinese and …. At the beginning of the game the player picks n piles of stones in a line. This is the best place to expand your knowledge and get prepared for your next interview. com is a domain located in United States that includes lintcode and has a. If the site was up for sale, it would be worth approximately $18,062 USD. The problem: Given n distinct positive integers, integer k (k <= n) and a number target. Lintcode String Permutation Given two strings, write a method to decide if one is a permutation of the other. Comparison of a nut to another nut or a bolt to another bolt is not allowed. Maximum Product Subarray Question. This is the best place to expand your knowledge and get prepared for your next interview. com has the potential to earn $2,580 USD in advertisement revenue per year. I have an array, which is filled with numbers so that it contains empty and non-empty elements and in fact consists of several arrays. A + B Problem Write a function that add two numbers A and B. 刷题是个漫长的过程, 学会保持自己的好奇心和能动力还是很重要的. Lintcode 618. Powerful coding training system. Now you need to pick k position to build k post office, so that the sum distance of each house to the nearest post office is the smallest. Nuts & Bolts Problem Question. I decided to use dfs using a traditional array as a queue. At the beginning of the game the player picks n piles of stones in a line. 1、这是我的第一个博客，本菜鸟新入住~还希望和各位大牛多多学习。本人是大三的学生，最近在LintCode上面开始刷题，因为要准备开始找工作面试了，所以多做点算法题来提高一下自己。2、今天在LintCo 博文 来自： qq_36839231的博客. py d, default title is the file_name; submit file to discuss with a title message: lc s 0001-a-b-problem. Given an unsorted array nums, reorder it such that sort ii Coin Wiggle Sort II Wiggle Sort II C++ Sort Integers II jiuzhang Sort Integers II Wiggle. Powerful coding training system. Lintcode: Nuts & Bolts Problem quick sort非常好的题。 用bolts[start]将nuts partition成两部分，得到中间值pivot，再用nuts[pivot]将bolts分成两部分。. String(6) LintCode-32. Compute and return the square root ofx, where x is guaranteed to be a non-negative integer. Binary Tree Traversal. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger/smaller. We provide Chinese and …. It should support the following operations: get and put. Design and implement a data structure for Least Recently Used (LRU) cache. Search Graph Nodes Given a undirected graph , a node and a target , return the nearest node to given node which value of it is target, return NULL if you can't find. We provide Chinese and. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. we provide chinese and english versions for coders around the world. LintCode 领扣. For example, length of LIS for { 10, 22, 9, 33, 21, 50, 41, 60, 80 } is 6 and LIS is {10, 22, 33, 50, 60, 80}. Return the sum of the subarray. Comparison of a nut to another nut or a bolt to another bolt is not allowed. py d 'your_title' open solution for problem 1 at jiuzhang: lc j 1; open leaderboard for problem 1 at lintcode: lc l 1; Languages. At LeetCode, our mission is to help you improve yourself and land your dream job. Free interview details posted anonymously by VMware interview candidates. A + B Problem Write a function that add two numbers A and B. LeetCode Problems' Solutions. Each item may be chosen unlimited number of times. English, 极少更新; 简体中文, 经常更新; 繁體中文, 极少更新; 简介. Say you have an array for which the i th element is the price of a given stock on day i. When you meet this problem in a real interview, the. LintCode & LeetCode; Introduction Linked List Sort List The Skyline Problem. Given an array of integers, find two non-overlapping subarrays which have the largest sum. Knapsack Problems Depth-first Search Large Number Operation SegmentFault: [LintCode] Backpack I II III IV V VI [背包六问] results matching "". Give you an array of integer means the the position of each house. Two Strings Are Anagrams LintCode-171. Leetcode Premium vs Lintcode VIP. Note The subarray should contain at least one number Example For given [1, 3, -1, 2, -1, 2], the two subarrays are [1, 3] and [2, -1, 2] or [1, 3, -1, 2] and [2], they both have the largest sum 7. Given a set of n nuts of different sizes and n bolts of different sizes. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. com Powerful coding training system. Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. 我先泼盆冷水，你这不叫对计算机硬件有初步了解，你这只是会装机。同理，对装系统改设置什么什么软件用得贼6的同学，你们这也不叫对计算机软件有了解，你这只是会用而已。. com has ranked N/A in N/A and 1,574,833 on the world. So, I was coding a problem on lintcode (number 69). String(6) LintCode-32. Now you need to pick k position to build k post office, so that the sum distance of each house to the nearest post office is the smallest. Last updated on Monday, 29 June 2015. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one. There is a one-one mapping between nuts and bolts. Find k numbers where sum is target. Comparison of a nut to another nut or a bolt to another bolt is not allowed. At LeetCode, our mission is to help you improve yourself and land your dream job. Yes! Site Lintcode. Congratulations, Your submission is Accepted! Want more practises can filter by difficulty, algorithm and data structure?. You should not use + or any arithmetic operators. Leetcode, Lintcode, Hackerrank, Hackerearth and Interviewbit are some of the leading preparation platforms. However, you need to make sure you make the most of them, and for that you need to track your progress. The references here are slides and articles. 196 in Beijing, China. Powerful coding training system. On one line there are n houses. It will automatically search solutions for your problems. gl/1TCNB6 算法解题教程LintCode全集： https://goo. what I want to do: do more leetcode practice; get a good grade ( ML, Database ). Note The subarray should contain at least one number Example For given [1, 3, -1, 2, -1, 2], the two subarrays are [1, 3] and [2, -1, 2] or [1, 3, -1, 2] and [2], they both have the largest sum 7. powerful coding training system. a + b without carry; 2. 2013(10-12月) 码农类 硕士 实习@Facebook - 校园招聘会 - Onsite 校园招聘会 |Pass. Knapsack Problems Depth-first Search Large Number Operation SegmentFault: [LintCode] Backpack I II III IV V VI [背包六问] results matching "". 我先泼盆冷水，你这不叫对计算机硬件有初步了解，你这只是会装机。同理，对装系统改设置什么什么软件用得贼6的同学，你们这也不叫对计算机软件有了解，你这只是会用而已。. Level up your coding skills and quickly land a job. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. LinkedIn Dynamic Programming Subarray. Lintcode: Nuts & Bolts Problem quick sort非常好的题。 用bolts[start]将nuts partition成两部分，得到中间值pivot，再用nuts[pivot]将bolts分成两部分。. Given n items with size nums[i] which an integer array and all positive numbers, no duplicates. Powerful coding training system. LintCode 3 Sum. Given an array of integers, find two non-overlapping subarrays which have the largest sum. Implement Queue. Given two strings, find the longest common subsequence (LCS). See all oodesign problems: #oodesign Review: Object-Oriented Design Problems; LintCode: Student Level; LintCode: Student ID; LintCode: Implement Queue by Circular Array. Comparison of a nut to another nut or a bolt to another bolt is not allowed. Post Office Problem 435 Question. The goal is to merge the stones in one pile observing the following rules:. We also need to pre-calculate the cost between any two points with a single post office. This site service in United States. lintcode-cli Demo. lintcode has the most interview problems covering google, facebook, linkedin, amazon, microsoft and so on. We provide Chinese and …. 实际上我FB的offer2个多月前就拿了, 当时一直想发个帖分享经验, 但是当时竟然没有发现面经版…. com - Lintcode Website. You should not use + or any arithmetic operators. Two Strings Are Anagrams LintCode-171. lintcode has the most interview problems covering google, facebook, linkedin, amazon, microsoft and so on. Contribute to awangdev/LintCode development by creating an account on GitHub. The purpose of LeetCode is to provide you hands-on training on real coding interview questions. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger/smaller. Powerful coding training system. I've tried to report the problem to [email protected] You may not modify the values in the list's nodes, only nodes itself may be changed. Return the largest sum. Implement strStr(). Julia likes the article written in Chinese, it is a well-written and very good thinking process about the problem solving. 我的初始阶段都是刷lintcode的, 刷的比较轻松愉快. 刷题是个漫长的过程, 学会保持自己的好奇心和能动力还是很重要的. String(6) LintCode-32. Here is the classification of all 289 problems. 看文献，早已成为了研究生的日常，如何更高效的筛选和阅读文献呢？这里分享一些我自己常用的插件。1， Scholarscope这是我最喜欢的一个插件，使用它之后可以查看Pubmed检索的文献的影响因子、引用数量以及中科院分区。. LeetCode/LintCode的题目量确实差不太多. Given an array of integers, how many three numbers can be found in the array, so that we can build an triangle whose three edges length is the three numbers that we find?. trying to find the longest substring of string "abcdab"'s longest substring is "abcd" Given a string, find the length of the longest substring without repeating characters. LintCode is a online judge for coding interview. We have a sizable repository of interview resources for many companies. LintCode 领扣. Powerful coding training system. The number in each subarray should be contiguous. Contribute to haoel/leetcode development by creating an account on GitHub. 虽然题目中涉及的f(x) g(x) h(x)和输出的结果r(x)最高次都不会超过1000, 但中间结果f(x) * g(x)的最高次可能会超过1000，最大到2000. Given an array of integers, find two non-overlapping subarrays which have the largest sum. com Website Analysis (Review) Lintcode. Have you met this question in a real interview?. Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 本文档为数据结构和算法学习笔记，主要作者 @billryan. Level up your coding skills and quickly land a job. Understand the problem: The longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order. Nuts & Bolts Problem Question. In the past few years, our users have landed jobs at top companies around the world. 0 by StuffGate. It is another back pack problem, choosing k items out of n items. Alexa ranks on #218,569 in the world ranking. However, you need to make sure you make the most of them, and for that you need to track your progress. This extension is a useful helper when you code at LeetCode/LintCode. Description Given a target word targets and a collection of n words words, can you select some words from words and select one letter from each word to compose the target word target ?. Stay tuned for updates. On one line there are n houses. Contribute to clairett/Leetcode-Lintcode-Python development by creating an account on GitHub. It needs extra memory which is O(n), where the n represents the length of the input string, to store the information if this char in string has been added. sudo npm i -g lintcode-cli. 251 and it is a. Although I have already solved it. Delete Digits… on Lintcode: delete digits: Leetcode: House Robb… on Leetcode: House Robber: Leetcode: Course Sch… on Lintcode: Topological order: Leetcode: Implement… on Leetcode: Add and Search Word…. At the beginning of the game the player picks n piles of stones in a line. Basically an array…. 打通你的Lintcode和leetcode的任督二脉，面对算法不再愁，剑指Offer，笑傲FLAG! Channel首页： https://goo. We provide Chinese and …. Best Time to Buy and Sell Stock I. This is the best place to expand your knowledge and get prepared for your next interview. 0 by StuffGate. 本文档为数据结构和算法学习笔记，主要作者 @billryan. Comparison of a nut to another nut or a bolt to another bolt is not allowed. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. Given a linked list, swap every two adjacent nodes and return its head. The goal is to merge the stones in one pile observing the following rules:. com is rated 4. abcd is a permutation of bcad, but abbe is not a permutation of abe Here permutation means one arrangement of the characters. Lintcode String Permutation Given two strings, write a method to decide if one is a permutation of the other. The number of problems is increasing recently. LintCode is a online judge for coding interview. com has the potential to earn $2,580 USD in advertisement revenue per year. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger/smaller. For example, length of LIS for { 10, 22, 9, 33, 21, 50, 41, 60, 80 } is 6 and LIS is {10, 22, 33, 50, 60, 80}. Say you have an array for which the i th element is the price of a given stock on day i. Related Problems. LintCode 领扣. It should support the following operations: get and put. For example, length of LIS for { 10, 22, 9, 33, 21, 50, 41, 60, 80 } is 6 and LIS is {10, 22, 33, 50, 60, 80}. Hosted on IP address 119. Minimum Window Substring LintCode-55. I understand how to solve the question if these two nodes must in the Binary Tree, but what if they do not have to be in the tree? If only one or none of these nodes in the tree, return None. powerful coding training system. We have a sizable repository of interview resources for many companies. Max Points on a Line LintCode-488. The problem is you cannot really define a good API that works for both of them. Find k numbers where sum is target. We provide Chinese and. Powerful coding training system. 上篇我是如何在一晚上拿到阿里巴巴offer一文分享给大家后，获得大家一致好评，都说学到了很多面试技巧。 但这次我要说的是面试技巧只能让你提高获得面试资格的概率，最终能不能拿到offer还得看你的硬实力。. 0 by StuffGate. Given an array A of integer with size of n( means n books and number of pages of each book) and k people to copy the book. Lintcode: Nuts & Bolts Problem quick sort非常好的题。 用bolts[start]将nuts partition成两部分，得到中间值pivot，再用nuts[pivot]将bolts分成两部分。. And if you decide to spend time preparing for the algorithms and data structure problems, you will need a good resource which lets you focus on problem solving rather than overwhelming you with a lot of content. The domain lintcode. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. com extension. Minimum Window Substring LintCode-55. Alexa ranks on #218,569 in the world ranking. We also need to pre-calculate the cost between any two points with a single post office. Happy Number Data Structure(9) LintCode-40. This is an example with Visual Studio Code editor, you can use any editor as you like. Of all these, Leetcode is the most famous one because of its vast collection of questions and a company focussed preparation style. we provide chinese and english versions for coders around the world. LintCode 领扣. 刷题是个漫长的过程, 学会保持自己的好奇心和能动力还是很重要的. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger/smaller. py d, default title is the file_name; submit file to discuss with a title message: lc s 0001-a-b-problem. We provide Chinese and …. Given an integer array, find a continuous rotate subarray where the sum of numbers is the biggest. English, 极少更新; 简体中文, 经常更新; 繁體中文, 极少更新; 简介. Powerful coding training system. LintCode 领扣. I decided to use dfs using a traditional array as a queue. Give you an array of integer means the the position of each house. Compare Strings LintCode-133. Congratulations, Your submission is Accepted! Want more practises can filter by difficulty, algorithm and data structure?. Leetcode, Lintcode, Hackerrank, Hackerearth and Interviewbit are some of the leading preparation platforms. Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one. com has ranked N/A in N/A and 1,574,833 on the world. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger. The purpose of LeetCode is to provide you hands-on training on real coding interview questions. You may not modify the values in the list's nodes, only nodes itself may be changed. However, you need to make sure you make the most of them, and for that you need to track your progress. So, I was coding a problem on lintcode (number 69). It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger/smaller. If the array before adjustment is A, the array after adjustment is B, you should minimize the sum of |A[i]-B[i]|. [LintCode] 619 Binary Tree Longest Consecutive Sequence III 解题报告 Description It's follow up problem for Binary Tree Longest Consecutive Sequence II Given a k-ary tree, find the length of the longest consecutive sequence path. The problem: Given n distinct positive integers, integer k (k <= n) and a number target. The a+b then equals to part 1 plus part 2. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. 上篇我是如何在一晚上拿到阿里巴巴offer一文分享给大家后，获得大家一致好评，都说学到了很多面试技巧。 但这次我要说的是面试技巧只能让你提高获得面试资格的概率，最终能不能拿到offer还得看你的硬实力。. A + B Problem Write a function that add two numbers A and B. Given an array of integers, find the subarray with smallest sum. However, you need to make sure you make the most of them, and for that you need to track your progress. Note The subarray should contain at least one number Example For given [1, 3, -1, 2, -1, 2], the two subarrays are [1, 3] and [2, -1, 2] or [1, 3, -1, 2] and [2], they both have the largest sum 7. Julia likes the article written in Chinese, it is a well-written and very good thinking process about the problem solving. We provide Chinese and …. 模拟题， 需要注意的两个地方： 1. Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Preface FAQ Guidelines for Contributing Part I - Basics. Powerful coding training system. Congratulations, Your submission is Accepted! Want more practises can filter by difficulty, algorithm and data structure?. 我先泼盆冷水，你这不叫对计算机硬件有初步了解，你这只是会装机。同理，对装系统改设置什么什么软件用得贼6的同学，你们这也不叫对计算机软件有了解，你这只是会用而已。. powerful coding training system. Given an unsorted array nums, reorder it such that sort ii Coin Wiggle Sort II Wiggle Sort II C++ Sort Integers II jiuzhang Sort Integers II Wiggle. Yes! Site Lintcode. At the beginning of the game the player picks n piles of stones in a line. FAQ Guidelines for Contributing Contributors Part I - Basics. FAQ Guidelines for Contributing Contributors Part I - Basics. LintCode has the most interview problems covering Google, Facebook, Linkedin, Amazon, Microsoft and so on. Find k numbers where sum is target. We provide Chinese and …. Given n items with size nums[i] which an integer array and all positive numbers, no duplicates. Lintcode String Permutation Given two strings, write a method to decide if one is a permutation of the other. Comparison of a nut to another nut or a bolt to another bolt is not allowed. Compare Strings LintCode-133. Now you need to pick k position to build k post office, so that the sum distance of each house to the nearest post office is the smallest. And if you decide to spend time preparing for the algorithms and data structure problems, you will need a good resource which lets you focus on problem solving rather than overwhelming you with a lot of content. Each item may be chosen unlimited number of times. LintCode 3 Sum. Problem 重复选择+唯一排列+装满可能性总数. I decided to use dfs using a traditional array as a queue. For example, length of LIS for { 10, 22, 9, 33, 21, 50, 41, 60, 80 } is 6 and LIS is {10, 22, 33, 50, 60, 80}. Congratulations, Your submission is Accepted! Want more practises can filter by difficulty, algorithm and data structure?. Lintcode 618. Study the blog - longest common substring (60 minutes reading first time/ 20 minutes review every 6 months) written by a facebook engineer, Ider Zheng. Leetcode Premium vs Lintcode VIP. Posted on November 11, 2015 November 11, 2015 by armsky. Comparison of a nut to another nut or a bolt to another bolt is not allowed. Each item may be chosen unlimited number of times. 196 in Beijing, China. LintCode & LeetCode; Introduction Linked List Sort List The Skyline Problem. A + B Problem Write a function that add two numbers A and B. The problem is you cannot really define a good API that works for both of them. Given two identical-sized string array A, B and a string S. At the beginning of the game the player picks n piles of stones in a line. Powerful coding training system. They replied in a day. We provide Chinese and …. Search Graph Nodes Given a undirected graph , a node and a target , return the nearest node to given node which value of it is target, return NULL if you can't find. we provide chinese and english versions for coders around the world. lintcode-cli Demo. Alexa ranks on #218,569 in the world ranking. ️Big data engineer. 0 by StuffGate. Up to date (2016-08-22), there are 289 problems on LintCode Online Judge. com Website Analysis (Review) Lintcode. Happy Number Data Structure(9) LintCode-40. Given an array of integers, find the subarray with smallest sum. The domain age is not known and their target audience is Powerful coding training system. Comparison of a nut to another nut or a bolt to another bolt is not allowed. LintCode & LeetCode; Introduction Linked List Sort List The Skyline Problem. Description Given a target word targets and a collection of n words words, can you select some words from words and select one letter from each word to compose the target word target ?. Medium Best Time to Buy and. LeetCode Problems' Solutions. I post their reply here anyway. Lintcode: K sum Given n distinct positive integers, integer k (k <= n) and a number target. Powerful coding training system. We provide Chinese and …. LintCode题解 ; Introduction Post Office Problem 435 Perfect Squares 513 Longest Palindromic Substring 200 Stone Game 476 Bomb Enemy 553. If part1+part2 generates more carry, we can then repeat this procedure, until there is no carry. Autumn is around the corner: Keep moving forward, looking for summer internship. abcd is a permutation of bcad, but abbe is not a permutation of abe Here permutation means one arrangement of the characters. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: