五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

database_Leet code 2118. Build the Equation

2022-02-20 19:21 作者:您是打尖兒還是住店呢  | 我要投稿

+-------------+------+?

| Column Name | Type |?

+-------------+------+?

| power ? ? ? | int ?|?

|factor ? ? ?| int ?|

+-------------+------+

power is the primary key column for this table.?

Each row of this table contains information about one term of the equation.?

power is an integer in the range [0, 100].

factor is an integer in the range [-100, 100] and cannot be zero.

You have a very powerful program that can solve any equation of one variable in the world. The equation passed to the program has to follow the following rules: The LHS should contain all the terms.?

The RHS should be zero.

Each term of the LHS should follow the format "sign factor X ^power" after removing the white spaces where: sign is either "+" or "-". factor is the absolute value of the factor.

power is the value of the power.?

If the power is 1, do not add "^power".?

For example, if power = 1 and factor = 3, the term will be "+3X".?

If the power is 0, add neither "X" nor "^power".?

For example, if power = 0 and factor = -3, the term will be "-3".

The powers in the RHS should be sorted in descending order.

Write an SQL query to build the equation.?

The query result format is in the following example.


Terms table:?

+-------+--------+?

| power | factor |

+-------+--------+?

| 2 ? ? | 1 ? ? ?|

| 1 ? ? | -4 ? ? |

| 0 ? ? | 2 ? ? ?|

+-------+--------+

Output:?

+--------------+

| equation ? ? |

+--------------+?

| +1X^2-4X+2=0 |?

+--------------+

Example 2:?

Input:

Terms table:

+-------+--------+?

| power | factor |

+-------+--------+?

| 4 ? ? | -4 ? ? |

| 2 ? ? | 1 ? ? ?|?

| 1 ? ? | -1 ? ? |

+-------+--------+

Output:

+-----------------+?

| equation ? ? ? ?|

+-----------------+?

| -4X^4+1X^2-1X=0 |?

+-----------------+

主要用自聯(lián)接,stuff for xml path 還有convert? 0的情況沒單獨驗證,后面有機會驗證一下,太困了。

database_Leet code 2118. Build the Equation的評論 (共 條)

分享到微博請遵守國家法律
苍南县| 天长市| 林口县| 若羌县| 大邑县| 山西省| 临西县| 柯坪县| 喀喇| 宣汉县| 高邮市| 龙井市| 敦化市| 贵州省| 若尔盖县| 营口市| 紫阳县| 武邑县| 宝兴县| 读书| 新乡市| 监利县| 化州市| 邛崃市| 静安区| 克东县| 晋州市| 务川| 西畴县| 松桃| 吉林市| 巩留县| 元氏县| 桑植县| 静宁县| 庆阳市| 扶余县| 阿巴嘎旗| 古交市| 东阿县| 丹巴县|