As an app developer, it's impossible not to have the task to display an icon in the app. One of the common ways to display icons , instead of using images or SVGs , is by using font files (.ttf, .otf or .woff). Although font files are usually used to display text with a specific font, but they can also be used to display icons . Instead of containing glyphs with letters , they contain glyphs with icons : There are different types of font technologies but the most common ones today are the TrueType (.ttf), OpenType (.otf) or the WOFF (.woff) font files. The way they store and render the glyphs is using a collection of line and curve commands as well as a collection of hint , which allows them to provide both relatively fast drawing speed and true device independence . The device independence is a key aspect given the myriad of display sizes and technologies which exist today. Referring to an icon inside of a icon font file works by knowing the hexadecimal val...
solution:
ReplyDeletelet the number be like this:
xn..x2x1x0y
where xn .. x2, x1, x0 are the number digits
Sum (xi * 10^i) + 9999 = Sum (xi * 10^(i+1)) + y, where i = 0..n
this gives:
9 * Sum(xi * 10^i) + y = 9999
now, y can be 0,1,2, .. 9
which means that
Sum(xi * 10^i) = 9999 / 9, 9998 / 9, 9997 / 9, ... 9990 / 9
but Sum must be integer since xi is integer also, hence
999z / 9, z = 0..9 must be integral
so we need to check all 9 ratios
actually its simpler(aratare!) if u divide
ReplyDelete9 * Sum(xi * 10^i) + y = 9999
by 9
and u get
Sum(xi * 10^i) + y/9 = 1111
y can be 0 or 9 ;)
Problem #2:
ReplyDeleteThe bridge
Three people (A, B, and C) need to cross a bridge. A can cross the bridge in 10 minutes, B can cross in 5 minutes, and C can cross in 2 minutes. There is also a bicycle available and any person can cross the bridge in 1 minute with the bicycle. What is the shortest time that all men can get across the bridge? Each man travels at their own constant rate.
I didn't solve this problem.
Hint: if you know that d = v * t then everything is easy :|
Solution to problem #2
ReplyDelete----------------------
The bicycle can be left at any place on the bridge and can be used in both directions on the bridge.
The steps are:
B and C walk by foot and A take the bicycle.
A at one place (y) can leave the bicycle and finish the way by foot.
C can take the bicycle, drives it back to a point (x), leaves it and continues to walk by foot.
B takes the bicycle and drives it all the way.
The equations are:
A: 1*y + 10*(1-y)
B: 5*x + 1*(1-x)
C: 2*y + (y-x) + 2*(1-x)
The system becomes:
10 - 9y = -3x + 3y + 2 = 4x + 1
Solve each equality:
10 - 9y = -3x + 3y + 2 -> 3x - 12y = -8
10 - 9y = 4x + 1 -> 4x + 9y = 9
After solving the equations:
x = 12/25, y=59/75.
It meas that it takes 73/25 = 2.92 minutes to cross the bridge.
A speed = 1/10
B speed = 1/5
C speed = 1/2
(bicycle speed is 1)
Problem #3:
ReplyDeleteYou have 2 buckets with water, 7 and 4 litre.
How can you measure 1 litre using these buckets ?
Solution to problem #3
ReplyDelete----------------------
Fill the 4 litre bucket then fill the 7 litre bucket with it completely.
Now you have 3 litre left in the 7 litre bucket.
Again, fill the 4 litre bucket and fill the remaining 3 litre from the 7 litre bucket.
What you have left in the 4 litre bucket is 1 litre.
problem #4:
ReplyDeleteexchange 2 variables without using any intermediate value.