Регулярные короткие заметки по C# и .NET.
Просто о сложном для каждого.
admin - @haarrp
Post #168
941
C# @csharp_1001_notes
Showing posts older than #170 · Back to latest



OddishOrEvenish(43) ➞ "Oddish"🏆 Leave your solutions in the comments. The solution will be posted below in a couple of hours 👇
// 4 + 3 = 7
// 7 % 2 = 1
OddishOrEvenish(373) ➞ "Oddish"
// 3 + 7 + 3 = 13
// 13 % 2 = 1
OddishOrEvenish(4433) ➞ "Evenish"
// 4 + 4 + 3 + 3 = 14
// 14 % 2 = 0
WeakReference class to create a weak reference to the tree and destroy all strong references. When the user switches back to the tree, the application attempts to obtain a strong reference to the tree and, if successful, avoids reconstructing the tree.




pentagonal(1) ➞ 1🏆 Leave your solutions in the comments. The solution will be posted below in a couple of hours 👇
pentagonal(2) ➞ 6
pentagonal(3) ➞ 16
pentagonal(8) ➞ 141
results = collectionWith deferred execution, the above iterates your collection one time, and each time an item is requested during the iteration, performs the map operation, filters, then uses the results to build the list.
.Select(item => item.Foo)
.Where(foo => foo < 3)
.ToList();


"fly") = dist("h", "f") + dist("o", "l") + dist("u", "y") + dist(house.Length, fly.Length)
= |104 - 102| + |111 - 108| + |117 - 121| + |5 - 3|
= 2 + 3 + 4 + 2
= 11
Examples:LetterDistance("sharp", "sharq") ➞ 1
LetterDistance("abcde", "Abcde") ➞ 32
LetterDistance("abcde", "bcdef") ➞ 5
🏆 Leave your solutions in the comments. The solution will be posted below in a couple of hours 👇
ReferenceEquals() method - checks if two reference type variables(classes, not structs) are referred to the same memory address.virtual Equals() method. (System.Object) - checks if two objects are equivalent.static Equals() method - is used to handle problems when there is a null value in the check.Equals method from IEquatable interface.== - usually means the same as ReferenceEquals, it checks if two variables point to the same memory address. The gotcha is that this operator can be override to perform other types of checks. In strings, for instance, it checks if two different instances are equivalent.