Tags » Math

LeetCode -- Palindrome Number

Problem:

Determine whether an integer is a palindrome. Do this without extra space.

Thought:

自己写的第一种方法,写完通过觉得自己好棒!:)

为什么写出第一个解法,原因是这样的:

  • 我不想首先拿这个数字是多少位。我想在循环的过程中,拿到最高位和最低位,不停循环/10拿到最高位,觉得循环好多。=》 这个在第二种方法中解决了。不停/10。注意:while loop  x/div >=10
  • 在拿到最高位和最低位之后,我不知道怎么迭代往中间走。=》 第二种方法解决:x = (x%div)/10;  div=div/100…
  • 86 more words
Leetcode

LeetCode -- Plus One

Problem:

Given a non-negative number represented as an array of digits, plus one to the number.

The digits are stored such that the most significant digit is at the head of the list. 76 more words

Leetcode

Final Math Project

In Math 1050 I did a project about calculating a 30-year and 15-year mortgage for the same house.  I used many of the skills learned in the class including calculating interest, algebra, and deductive reasoning skills.  (click to enlarge photos)

     

     

Math1050

LeetCode -- Pow(x, n)

Problem:

Implement pow(x, n).

Thought:

Nothing showed in my mind when it occurred to me. Only the main logic showed up. But the method of getPow(x,n) does not show up. 56 more words

Leetcode

Drama by math department standards

    He eschews job offers from prestigious East Coast institutions in favor of a relaxed, no-drama department in a place where he can enjoy the weather. — … 47 more words
Math

Link Dump

There have been a bunch of really good articles on math related stuff. A lot of these have been mentioned on other blogs — see the hat tips — but I want to collect them all here so I don’t forget about them. 541 more words

Math