For two strings A and B, we define the similarity of the strings to be the length of the longest prefix common to both strings. For example, the similarity of strings “abc” and “abd” is 2, while the similarity of strings “aaa” and “aaab” is 3. Calculate the sum of similarities of a string S […]
Fibonacci
Complete the function fibonacci to return an array containing the first N Fibonacci numbers. fib(n) = n , n <= 1 fib(n) = fib(n-2) + fib(n-1), otherwise Constraints: 1 ≤ N ≤ 10 Sample Input 4 Sample Output 0 […]
Calculate Factorial
Write a program that will read an integer N from STDIN and compute the factorial of N. The input to your program will contain many lines. On each line there will be exactly one integer. Your program should print the factorial of each integer in a separate line. Your program should terminate when it reads a number […]
Maximum Difference in an Array
Return the maximum difference between any a[i] and a[j] where a[i] < a[j] and i < j The maximum difference for a pair of elements in some array a is defined as the largest difference between any a[i] and a[j] where i < j and a[i] < a[j]. The declaration for a function named maxDifference […]
Sửa lỗi cài win “Setup was unable to create a new system partition or locate an existing system partition”
Hiện nay do công nghệ thay đổi, nên trong khi cài Windows từ thiết bị ngoài USB, các bạn hay gặp phải lỗi sau: “Setup was unable to create a new system partition or locate an existing system partition” Về lý do vì sao bị lỗi tôi sẽ cập nhật tại bài viết này sau hoặc […]
Luyện Đọc Nhanh
Bạn biết gì về đọc nhanh? liệu bạn đã đọc nhanh hay chưa? Hay xem qua bài Luyện Đọc Nhanh để xem bạn đã đọc đúng cách chưa nhé! Bạn biết gì về đọc nhanh? Và Luyện Đọc Nhanh? Hiểu đúng về đọc nhanh Đọc nhanh là nhìn: Bạn đọc được vài từ một lần […]
8 Câu Nói Giúp Bạn Không Phải Hối Tiếc Vì Lựa Chọn Sai Trong Cuộc Đời
Trong cuộc đời mỗi người, ai ai cũng có rất nhiều lựa chọn. Đứng trước mỗi lựa chọn, chúng ta lại phân vân đắn đo xem chọn cái nào mới đúng? Phía dưới là 8 câu nói bạn cần nhớ kỹ để không phải phạm sai lầm quá lớn trong cuộc đời. 1. Thà rằng […]
How To Change Forgotten Password On Ubuntu 14.04 Servers
Since we’re all humans and we do forget at times, this brief tutorial is going to show you how to reset or recovery a forgotten users or root password on Ubuntu 14.04. Now, something you should understand before you continue. This method will only work if you’re directly connected to the machine and able to […]
Types of software Testing
Software Testing Types: Black box testing – Internal system design is not considered in this type of testing. Tests are based on requirements and functionality. White box testing – This testing is based on knowledge of the internal logic of an application’s code. Also known as Glass box Testing. Internal software and code working should […]
Người xưa xem trọng điều gì nhất, tiền bạc, địa vị hay tài năng?
Một điều thú vị rằng, tất cả những điều liệt kê bên trên đều không phải những thứ mà người xưa xem trọng nhất. Mà đó chính là… Nhẫn là pháp bảo để tu thân và xử thế. Khổng Tử từng khuyên Tử Lộ rằng: “Trăm hành chi bản, nhẫn làm đầu”. Nhẫn không phải là […]