三个线程交替打印antantant…,一个打印a,一个打印n,一个打印t(编程语言自选)

Java实现,方法一,通过两把锁来控制打印,思路如下:

ThreadA,ThreadN,ThreadT分别会打印a,n,t,定义三把锁LockA,LockN,LockT作为对应打印线程必须要获取的锁,除此之外每个线程打印对应字母有序,也就是每个字母前面的字母是对应的,比如现在想打印n,那么前面必须已经打印了a[……]

Read more

有一个string类型数组arr ={ “a”, “b”, “d”, “d”, “a”, “d”, “a”, “e”, “d”, “c” },请编码实现统计该数组中字符重复次数并由多到少的顺序对a,b,c,d,e重新排序输出。(编码语言自选)

#!/usr/bin/env python

arr = ["a", "b", "d", "d", "a", "d", "a", "e", "d", "c"]
d[......]

Read more

原题:

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and retu[……]

Read more

原题:

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution, and you may not use the sa[……]

Read more